/* Project list - completed/archive row green */
[data-scope="Project"] .table tr.list-row.row-success,
[data-scope="Project"] .table tr.list-row.row-success > td {
    background-color: #d5f5e3 !important;
}

/* Archive box - always show full project numbers without ellipsis */
[data-scope="ArchiveBox"] .list-container table.table > tbody > tr > td[data-name="projectNumbers"],
[data-scope="ArchiveBox"] .list-container table.table > tbody > tr > td.cell[data-name="projectNumbers"] {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    max-height: none !important;
}

[data-scope="ArchiveBox"] .list-container table.table > tbody > tr > td[data-name="projectNumbers"] .cell-value,
[data-scope="ArchiveBox"] .list-container table.table > tbody > tr > td.cell[data-name="projectNumbers"] .cell-value,
[data-scope="ArchiveBox"] .list-container table.table > tbody > tr > td[data-name="projectNumbers"] a,
[data-scope="ArchiveBox"] .list-container table.table > tbody > tr > td.cell[data-name="projectNumbers"] a {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    display: inline !important;
    max-height: none !important;
}

[data-scope="ArchiveBox"] .detail .field[data-name="projectNumbers"] .field-value,
[data-scope="ArchiveBox"] .small-detail .field[data-name="projectNumbers"] .field-value {
    white-space: normal !important;
    word-break: break-word !important;
}

/* Project list - smaller header font + wrap for readability */
[data-scope="Project"] .list-container table.table > thead > tr > th {
    white-space: normal !important;
    text-overflow: clip !important;
    overflow: visible !important;
    font-size: 9px !important;
    padding: 5px 3px;
    line-height: 1.3;
    vertical-align: bottom;
}
[data-scope="Project"] .list-container table.table > thead > tr > th > a,
[data-scope="Project"] .list-container table.table > thead > tr > th > button {
    white-space: normal !important;
    text-overflow: clip !important;
    overflow: visible !important;
    font-size: 9px !important;
}

/* Project list - smaller font for data rows + wrap text */
[data-scope="Project"] .list-container table.table > tbody > tr > td {
    font-size: 9px !important;
    padding: 4px 3px;
    line-height: 1.3;
    white-space: normal !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    word-break: break-word;
}
[data-scope="Project"] .list-container table.table > tbody > tr > td a {
    white-space: normal !important;
    word-break: break-word;
    font-size: 9px !important;
}

/* Project list - always show full project name (wrap to multiple lines, no ellipsis). */
[data-scope="Project"] .list-container table.table > tbody > tr > td[data-name="name"],
[data-scope="Project"] .list-container table.table > tbody > tr > td.cell[data-name="name"] {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    max-height: none !important;
}

[data-scope="Project"] .list-container table.table > tbody > tr > td[data-name="name"] a,
[data-scope="Project"] .list-container table.table > tbody > tr > td.cell[data-name="name"] a,
[data-scope="Project"] .list-container table.table > tbody > tr > td[data-name="name"] .cell-value,
[data-scope="Project"] .list-container table.table > tbody > tr > td.cell[data-name="name"] .cell-value {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    display: inline !important;
    max-height: none !important;
}

/* Project list - row highlighting based on deadline status */
[data-scope="Project"] .list-container tr.list-row.row-danger,
[data-scope="Project"] table.table tr.list-row.row-danger {
    background-color: #f2dede !important;
}

[data-scope="Project"] .list-container tr.list-row.row-danger:hover,
[data-scope="Project"] table.table tr.list-row.row-danger:hover {
    background-color: #ebcccc !important;
}

[data-scope="Project"] .list-container tr.list-row.row-warning,
[data-scope="Project"] table.table tr.list-row.row-warning {
    background-color: #fcf8e3 !important;
}

[data-scope="Project"] .list-container tr.list-row.row-warning:hover,
[data-scope="Project"] table.table tr.list-row.row-warning:hover {
    background-color: #faf2cc !important;
}

/* Fix checkbox column dropdown overflow in list view header */
th.checkbox-cell {
    overflow: visible !important;
}

th.checkbox-cell .checkbox-dropdown .dropdown-menu {
    z-index: 1050 !important;
    min-width: 200px;
    white-space: nowrap;
}

/* Fix dropdown z-index in list view */
.list-row .dropdown-menu,
.list-row .selectize-dropdown,
.record-list .dropdown-menu,
table.table td .dropdown-menu {
    z-index: 1050 !important;
}

/* Ensure dropdown is visible above table rows */
.record-list tr:hover {
    z-index: auto;
}

.record-list td:focus-within,
.record-list td.cell:has(.selectize-input.dropdown-active) {
    overflow: visible !important;
}

/* Fix for enum field dropdown in list view */
.field[data-type="enum"] .selectize-dropdown,
.field[data-type="enum"] .dropdown-menu {
    z-index: 1050 !important;
    position: absolute !important;
}

/* Fix for dropdown overflow in detail/edit view */
.detail .panel-body .row,
.edit .panel-body .row,
.record .panel-body .row {
    overflow: visible !important;
}

.detail .panel-body,
.edit .panel-body,
.record .panel-body {
    overflow: visible !important;
}

/* Ensure select2/selectize dropdowns in detail/edit view are above other fields */
.detail .selectize-dropdown,
.edit .selectize-dropdown,
.record .selectize-dropdown,
.detail .select2-drop,
.edit .select2-drop,
.record .select2-drop {
    z-index: 1060 !important;
}

/* Fix z-index for cells in detail/edit view - only when dropdown is open */
.detail .cell .field.open,
.edit .cell .field.open,
.record .cell .field.open,
.detail .cell .field:focus-within,
.edit .cell .field:focus-within,
.record .cell .field:focus-within {
    position: relative;
    z-index: 1050;
}

/* Fix icon centering in btn-icon buttons */
.btn.btn-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

.btn.btn-icon > span {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
}

.btn.btn-icon .fa,
.btn.btn-icon .fas,
.btn.btn-icon .far,
.btn.btn-icon .fab {
    width: auto !important;
    margin: 0 auto !important;
}

/* Compare view - equal proportions for items and attachments */
.record-grid-compare .left .content-wrapper {
    grid-template-columns: 55% 45% !important;
}

/* Compare view - compact items text */
.record-grid-compare .middle .field[data-name="items"] {
    font-size: 12px;
}

.record-grid-compare .middle .field[data-name="items"] td {
    padding: 4px 6px;
    font-size: 12px;
    line-height: 1.3;
}

.record-grid-compare .middle .field[data-name="items"] .section-item {
    font-size: 12px;
}

.record-grid-compare .middle .field[data-name="items"] .section-title {
    font-size: 12px;
}

.record-grid-compare .middle .field[data-name="items"] .field-value {
    font-size: 12px;
    word-break: break-word;
}

/* Compare view - readable items table layout */
.record-grid-compare .field[data-name="items"] table.table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
}

.record-grid-compare .field[data-name="items"] th[data-name],
.record-grid-compare .field[data-name="items"] td[data-name] {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.record-grid-compare .field[data-name="items"] td[data-name="itemParent"] {
    overflow: visible !important;
    position: relative !important;
    z-index: 900 !important;
}

.record-grid-compare .field[data-name="items"] td[data-name="itemParent"] .cell-wrapper,
.record-grid-compare .field[data-name="items"] td[data-name="itemParent"] .input-group-link-parent,
.record-grid-compare .field[data-name="items"] td[data-name="itemParent"] .input-group-item:first-child,
.record-grid-compare .field[data-name="items"] td[data-name="itemParent"] .selectize-control {
    overflow: visible !important;
    position: relative !important;
    z-index: 950 !important;
}

.record-grid-compare .field[data-name="items"] td[data-name="itemParent"] .selectize-dropdown {
    overflow: visible !important;
    position: absolute !important;
    z-index: 1030 !important;
}

.record-grid-compare .field[data-name="items"] td[data-name="noteNumber"],
.record-grid-compare .field[data-name="items"] th[data-name="noteNumber"] {
    width: 8% !important;
    max-width: 8% !important;
}

.record-grid-compare .field[data-name="items"] td[data-name="cexpirationDate"],
.record-grid-compare .field[data-name="items"] th[data-name="cexpirationDate"] {
    width: 8% !important;
    max-width: 8% !important;
}

.record-grid-compare .field[data-name="items"] td[data-name="isReturnable"],
.record-grid-compare .field[data-name="items"] th[data-name="isReturnable"] {
    width: 4% !important;
    max-width: 4% !important;
}

/* Notifications - clear split between new and history for approval flow. */
.list-group-item .custom-notification-message .stream-head-text-container {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.list-group-item .custom-notification-message.is-clickable {
    cursor: pointer;
}

.list-group-item .custom-notification-message__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 4px 0;
}

.list-group-item .custom-notification-chip.label {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border-radius: 999px;
    padding: 2px 8px;
    line-height: 1.4;
}

.list-group-item .custom-notification-chip.state-new {
    background-color: #d9534f;
}

.list-group-item .custom-notification-chip.state-history {
    background-color: #6c757d;
}

.list-group-item .custom-notification-chip.approval-pending {
    background-color: #6c757d;
}

.list-group-item .custom-notification-chip.approval-approved {
    background-color: #5cb85c;
}

.list-group-item .custom-notification-chip.approval-rejected {
    background-color: #d9534f;
}

.list-group-item .custom-notification-chip.approval-generic {
    background-color: #5bc0de;
}

.list-group-item .custom-notification-message.state-history .message {
    opacity: 0.88;
}

.list-group-item .custom-notification-message.approval-pending .message {
    color: #6c757d;
}

.list-group-item .custom-notification-message.approval-approved .message {
    color: #3c763d;
    font-weight: 600;
}

.list-group-item .custom-notification-message.approval-rejected .message {
    color: #a94442;
}

.record-grid-compare .field[data-name="items"] td[data-name="itemParent"],
.record-grid-compare .field[data-name="items"] th[data-name="itemParent"] {
    width: 22% !important;
    max-width: 22% !important;
}

/* WorkTimeEnum detail - full width (no side panel) */
.detail[data-scope="WorkTimeEnum"] .record-grid {
    grid-template-columns: 1fr !important;
}
.detail[data-scope="WorkTimeEnum"] .record-grid > .side {
    display: none !important;
}
.detail[data-scope="WorkTimeEnum"] .record-grid > .left {
    width: 100% !important;
    min-width: 0 !important;
}

/* WorkTimeEnum attendances - compact table with sticky header */
.field[data-name="attendances"] .recordList {
    overflow-x: auto !important;
    overflow-y: auto !important;
    max-width: 100%;
    max-height: 70vh;
}

.field[data-name="attendances"] table.table {
    table-layout: fixed;
    font-size: 13px;
    border-collapse: separate;
    border-spacing: 0;
}

.field[data-name="attendances"] table.table thead th {
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    background-color: #333 !important;
    color: #fff !important;
    box-shadow: 0 1px 0 #ddd !important;
}

.field[data-name="attendances"] table.table th {
    font-size: 12px;
    padding: 4px 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.field[data-name="attendances"] table.table td {
    padding: 4px 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.field[data-name="attendances"] table.table td[data-name="remove-cross"],
.field[data-name="attendances"] table.table td[data-name="duplicate"],
.field[data-name="attendances"] table.table td[data-name="add-subcomponent"] {
    overflow: visible;
    position: sticky;
    right: 0;
    background-color: #fff;
    z-index: 5;
}

/* Hide clock icons on time fields - saves space */
.field[data-name="attendances"] .time-picker-btn {
    display: none !important;
}

/* Ensure edit buttons are visible */
.field[data-name="attendances"] .btn-group,
.field[data-name="attendances"] [data-action="addItem"],
.field[data-name="attendances"] [data-action="linkItems"] {
    display: inline-flex !important;
    visibility: visible !important;
}

/* valueFoodStamps - hide currency dropdown (always CZK) */
.field[data-name="attendances"] select[data-name="valueFoodStampsCurrency"],
.field[data-name="attendances"] .input-group-item:has(select[data-name="valueFoodStampsCurrency"]) {
    display: none !important;
}
.field[data-name="attendances"] .field[data-name="valueFoodStamps"] .input-group > .input-group-item:first-child > input {
    border-radius: 4px !important;
}

/* valueFoodStamps - hide currency symbol in list/detail mode (show only number) */
.field[data-name="attendances"] .field[data-name="valueFoodStamps"] > span {
    font-size: 0;
    letter-spacing: 0;
}
.field[data-name="attendances"] .field[data-name="valueFoodStamps"] > span .numeric-text {
    font-size: 13px;
}
.field[data-name="attendances"] .field[data-name="valueFoodStamps"] > span .none-value,
.field[data-name="attendances"] .field[data-name="valueFoodStamps"] > span .loading-value {
    font-size: 13px;
}

/* Hide default inline-edit pencil for attendances (replaced by custom Editovat button) */
.cell[data-name="attendances"] > .inline-edit-link {
    display: none !important;
}

/* Fix dropdown z-index in attendance table */
.field[data-name="attendances"] .selectize-dropdown,
.field[data-name="attendances"] .dropdown-menu,
.field[data-name="attendances"] .select2-drop,
.field[data-name="attendances"] .autocomplete-suggestions {
    z-index: 1100 !important;
    position: absolute !important;
}

.field[data-name="attendances"] .selectize-input.dropdown-active,
.field[data-name="attendances"] .select2-container-active,
.field[data-name="attendances"] td.cell:focus-within {
    z-index: 1050 !important;
    position: relative;
    overflow: visible !important;
}

.field[data-name="attendances"] tr:hover {
    z-index: auto !important;
}

/* WorkTimeEnum attendances - weekend/holiday row highlighting */
.field[data-name="attendances"] tr.list-row.attendance-day-weekend > td {
    background-color: #edf0f2 !important;
}

.field[data-name="attendances"] tr.list-row.attendance-day-holiday > td {
    background-color: #fde5d9 !important;
}

.field[data-name="attendances"] tr.list-row.attendance-day-weekend > td[data-name="day"],
.field[data-name="attendances"] tr.list-row.attendance-day-holiday > td[data-name="day"] {
    font-weight: 700;
}

.field[data-name="attendances"] td[data-name="day"] .attendance-day-short {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 5px;
    border-radius: 10px;
    font-size: 10px;
    line-height: 1.2;
    font-weight: 700;
    color: #334155;
    background-color: #dbe4ea;
    vertical-align: middle;
}

.field[data-name="attendances"] tr.list-row.attendance-day-weekend > td[data-name="day"] .attendance-day-short {
    background-color: #cfd8df;
}

.field[data-name="attendances"] tr.list-row.attendance-day-holiday > td[data-name="day"] .attendance-day-short {
    background-color: #f8c8b0;
    color: #7f2f0b;
}

@media (max-width: 767px) {
    .field[data-name="attendances"] .recordList {
        max-height: none !important;
        overflow: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .field[data-name="attendances"] table.table {
        min-width: 980px;
        table-layout: auto;
        font-size: 12px;
    }

    .field[data-name="attendances"] table.table th,
    .field[data-name="attendances"] table.table td {
        font-size: 11px;
        padding: 4px 5px;
    }

    .field[data-name="attendances"] td[data-name="project"],
    .field[data-name="attendances"] td[data-name="workPurpose"],
    .field[data-name="attendances"] td[data-name="cBuildingLocation"] {
        white-space: normal !important;
        text-overflow: clip !important;
        overflow: visible !important;
        word-break: break-word;
        min-width: 130px;
    }
}

/* Compact form inputs inside attendance table */
.field[data-name="attendances"] .form-control {
    font-size: 13px;
    padding: 3px 5px;
    height: 28px;
}

.field[data-name="attendances"] .selectize-input {
    font-size: 13px;
    padding: 3px 5px !important;
    min-height: 28px !important;
}

.field[data-name="attendances"] .selectize-input > input {
    font-size: 12px !important;
}

/* Checkbox column - minimal width */
.field[data-name="attendances"] th[data-name="isOnStandby"],
.field[data-name="attendances"] td[data-name="isOnStandby"] {
    text-align: center;
}

/* GoodsReceipt items - horizontal scroll; the minimum width is the sum of the fixed columns
   below plus the serial-number and action columns, so widening a column widens this too */
.detail[data-scope="GoodsReceipt"] .field[data-name="items"] .recordList,
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] .recordList {
    overflow-x: auto !important;
    overflow-y: visible !important;
    max-width: 100%;
    scrollbar-width: none;
}

.detail[data-scope="GoodsReceipt"] .field[data-name="items"] .recordList::-webkit-scrollbar,
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] .recordList::-webkit-scrollbar {
    height: 0;
}

.detail[data-scope="GoodsReceipt"] .field[data-name="items"] .recordList > .list,
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] .recordList > .list {
    min-width: 1840px;
}

.detail[data-scope="GoodsReceipt"] .field[data-name="items"] .recordList table.table,
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] .recordList table.table {
    min-width: 1840px;
    table-layout: fixed;
}

/* GoodsReceipt items - fixed column widths */
.detail[data-scope="GoodsReceipt"] .field[data-name="items"] th[data-name="product"],
.detail[data-scope="GoodsReceipt"] .field[data-name="items"] td[data-name="product"],
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] th[data-name="product"],
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] td[data-name="product"] {
    width: 260px !important;
    min-width: 260px !important;
}

.detail[data-scope="GoodsReceipt"] .field[data-name="items"] th[data-name="project"],
.detail[data-scope="GoodsReceipt"] .field[data-name="items"] td[data-name="project"],
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] th[data-name="project"],
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] td[data-name="project"] {
    width: 180px !important;
    min-width: 180px !important;
}

.detail[data-scope="GoodsReceipt"] .field[data-name="items"] th[data-name="description"],
.detail[data-scope="GoodsReceipt"] .field[data-name="items"] td[data-name="description"],
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] th[data-name="description"],
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] td[data-name="description"] {
    width: 220px !important;
    min-width: 220px !important;
}

.detail[data-scope="GoodsReceipt"] .field[data-name="items"] th[data-name="cReturnDate"],
.detail[data-scope="GoodsReceipt"] .field[data-name="items"] td[data-name="cReturnDate"],
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] th[data-name="cReturnDate"],
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] td[data-name="cReturnDate"] {
    width: 120px !important;
    min-width: 120px !important;
}

.detail[data-scope="GoodsReceipt"] .field[data-name="items"] th[data-name="cCreditNoteNumber"],
.detail[data-scope="GoodsReceipt"] .field[data-name="items"] td[data-name="cCreditNoteNumber"],
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] th[data-name="cCreditNoteNumber"],
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] td[data-name="cCreditNoteNumber"] {
    width: 170px !important;
    min-width: 170px !important;
}

.detail[data-scope="GoodsReceipt"] .field[data-name="items"] th[data-name="cDrumNumber"],
.detail[data-scope="GoodsReceipt"] .field[data-name="items"] td[data-name="cDrumNumber"],
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] th[data-name="cDrumNumber"],
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] td[data-name="cDrumNumber"] {
    width: 180px !important;
    min-width: 180px !important;
}

.detail[data-scope="GoodsReceipt"] .field[data-name="items"] th[data-name="cOrderNumber"],
.detail[data-scope="GoodsReceipt"] .field[data-name="items"] td[data-name="cOrderNumber"],
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] th[data-name="cOrderNumber"],
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] td[data-name="cOrderNumber"] {
    width: 190px !important;
    min-width: 190px !important;
}

.detail[data-scope="GoodsReceipt"] .field[data-name="items"] th[data-name="cDeliveryNoteSupplier"],
.detail[data-scope="GoodsReceipt"] .field[data-name="items"] td[data-name="cDeliveryNoteSupplier"],
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] th[data-name="cDeliveryNoteSupplier"],
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] td[data-name="cDeliveryNoteSupplier"] {
    width: 220px !important;
    min-width: 220px !important;
}

.detail[data-scope="GoodsReceipt"] .field[data-name="items"] th[data-name="cDeliveryNoteCompany"],
.detail[data-scope="GoodsReceipt"] .field[data-name="items"] td[data-name="cDeliveryNoteCompany"],
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] th[data-name="cDeliveryNoteCompany"],
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] td[data-name="cDeliveryNoteCompany"] {
    width: 220px !important;
    min-width: 220px !important;
}

.detail[data-scope="GoodsReceipt"] .field[data-name="items"] th[data-name="price"],
.detail[data-scope="GoodsReceipt"] .field[data-name="items"] td[data-name="price"],
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] th[data-name="price"],
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] td[data-name="price"] {
    /* The edit cell holds the amount input and the currency select (~70px); at 120px the
       input kept 2px for the digits and the price was unreadable (SUP-2459). */
    width: 200px !important;
    min-width: 200px !important;
}

.detail[data-scope="GoodsReceipt"] .field[data-name="items"] th[data-name="quantity"],
.detail[data-scope="GoodsReceipt"] .field[data-name="items"] td[data-name="quantity"],
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] th[data-name="quantity"],
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] td[data-name="quantity"] {
    width: 110px !important;
    min-width: 110px !important;
}

.detail[data-scope="GoodsReceipt"] .field[data-name="items"] th[data-name="positionTo"],
.detail[data-scope="GoodsReceipt"] .field[data-name="items"] td[data-name="positionTo"],
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] th[data-name="positionTo"],
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] td[data-name="positionTo"] {
    width: 170px !important;
    min-width: 170px !important;
}

/* GoodsReceipt items - dropdown z-index fixes */
.detail[data-scope="GoodsReceipt"] .field[data-name="items"] .selectize-dropdown,
.detail[data-scope="GoodsReceipt"] .field[data-name="items"] .dropdown-menu,
.detail[data-scope="GoodsReceipt"] .field[data-name="items"] .select2-drop,
.detail[data-scope="GoodsReceipt"] .field[data-name="items"] .autocomplete-suggestions,
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] .selectize-dropdown,
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] .dropdown-menu,
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] .select2-drop,
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] .autocomplete-suggestions {
    z-index: 1100 !important;
    position: absolute !important;
}

.detail[data-scope="GoodsReceipt"] .field[data-name="items"] .selectize-input.dropdown-active,
.detail[data-scope="GoodsReceipt"] .field[data-name="items"] .select2-container-active,
.detail[data-scope="GoodsReceipt"] .field[data-name="items"] td.cell:focus-within,
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] .selectize-input.dropdown-active,
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] .select2-container-active,
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] td.cell:focus-within {
    z-index: 1050 !important;
    position: relative;
}

.detail[data-scope="GoodsReceipt"] .field[data-name="items"] tr:hover,
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] tr:hover {
    z-index: auto !important;
}

.detail[data-scope="GoodsReceipt"] .field[data-name="items"] td,
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] td {
    overflow: visible !important;
    white-space: normal !important;
    vertical-align: top;
}

.detail[data-scope="GoodsReceipt"] .field[data-name="items"] th,
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] th {
    white-space: normal !important;
}

.detail[data-scope="GoodsReceipt"] .field[data-name="items"] td .form-control,
.detail[data-scope="GoodsReceipt"] .field[data-name="items"] td .main-element,
.detail[data-scope="GoodsReceipt"] .field[data-name="items"] td .selectize-input,
.detail[data-scope="GoodsReceipt"] .field[data-name="items"] td .selectize-control.single .selectize-input,
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] td .form-control,
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] td .main-element,
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] td .selectize-input,
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] td .selectize-control.single .selectize-input {
    min-height: 38px;
    font-size: 13px;
    line-height: 1.35;
}

.detail[data-scope="GoodsReceipt"] .field[data-name="items"] td .form-control,
.detail[data-scope="GoodsReceipt"] .field[data-name="items"] td textarea,
.detail[data-scope="GoodsReceipt"] .field[data-name="items"] td .selectize-input > input,
.detail[data-scope="GoodsReceipt"] .field[data-name="items"] td .selectize-input .item,
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] td .form-control,
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] td textarea,
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] td .selectize-input > input,
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] td .selectize-input .item {
    white-space: normal !important;
    overflow-wrap: anywhere;
}

.detail[data-scope="GoodsReceipt"] .field[data-name="items"] td .link-text,
.detail[data-scope="GoodsReceipt"] .field[data-name="items"] td .text-muted,
.detail[data-scope="GoodsReceipt"] .field[data-name="items"] td .field-value,
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] td .link-text,
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] td .text-muted,
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] td .field-value {
    white-space: normal !important;
    overflow-wrap: anywhere;
}

.detail[data-scope="GoodsReceipt"] .field[data-name="items"] .goods-receipt-items-scrollbar,
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] .goods-receipt-items-scrollbar {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 24px;
    margin-top: 8px;
    padding: 0 2px;
}

.detail[data-scope="GoodsReceipt"] .field[data-name="items"] .goods-receipt-items-scrollbar-range,
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] .goods-receipt-items-scrollbar-range {
    display: block;
    width: 100%;
    margin: 0;
    accent-color: #7f93aa;
}

.detail[data-scope="GoodsReceipt"] .field[data-name="items"] .goods-receipt-items-scrollbar-range::-webkit-slider-runnable-track,
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] .goods-receipt-items-scrollbar-range::-webkit-slider-runnable-track {
    height: 10px;
    background: #e3e8ee;
    border-radius: 999px;
}

.detail[data-scope="GoodsReceipt"] .field[data-name="items"] .goods-receipt-items-scrollbar-range::-webkit-slider-thumb,
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] .goods-receipt-items-scrollbar-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    margin-top: -6px;
    border: 1px solid #77889d;
    border-radius: 50%;
    background: #8fa3ba;
    cursor: ew-resize;
}

.detail[data-scope="GoodsReceipt"] .field[data-name="items"] .goods-receipt-items-scrollbar-range::-moz-range-track,
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] .goods-receipt-items-scrollbar-range::-moz-range-track {
    height: 10px;
    background: #e3e8ee;
    border-radius: 999px;
}

.detail[data-scope="GoodsReceipt"] .field[data-name="items"] .goods-receipt-items-scrollbar-range::-moz-range-thumb,
.edit[data-scope="GoodsReceipt"] .field[data-name="items"] .goods-receipt-items-scrollbar-range::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border: 1px solid #77889d;
    border-radius: 50%;
    background: #8fa3ba;
    cursor: ew-resize;
}

/* Fix linkParent type selector dropdown in record-list tables */
td.cell .input-group-link-parent .selectize-dropdown {
    min-width: 180px !important;
    z-index: 1030 !important;
    border: 1px solid #c7cfd6 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    position: absolute !important;
    background: #ffffff !important;
    opacity: 1 !important;
}

td.cell .input-group-link-parent .selectize-dropdown-content {
    background: #ffffff !important;
}

td.cell .input-group-link-parent .selectize-dropdown .option {
    padding: 6px 10px !important;
}

td.cell .input-group-link-parent .selectize-dropdown .option:hover,
td.cell .input-group-link-parent .selectize-dropdown .option.active {
    background-color: #4688d0 !important;
    color: #fff !important;
}

/* Fix linkParent type selector dropdown - in modals/forms */
.modal .input-group-link-parent .selectize-dropdown {
    min-width: 200px !important;
    z-index: 1065 !important;
    border: 1px solid #c7cfd6 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
}

.record .input-group-link-parent .selectize-dropdown {
    min-width: 200px !important;
    z-index: 1030 !important;
    border: 1px solid #c7cfd6 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
}

.modal .input-group-link-parent .selectize-dropdown .option,
.record .input-group-link-parent .selectize-dropdown .option {
    padding: 8px 12px !important;
}

.modal .input-group-link-parent .selectize-dropdown .option:hover,
.modal .input-group-link-parent .selectize-dropdown .option.active,
.record .input-group-link-parent .selectize-dropdown .option:hover,
.record .input-group-link-parent .selectize-dropdown .option.active {
    background-color: #4688d0 !important;
    color: #fff !important;
}

.modal .input-group-link-parent .selectize-dropdown-content,
.record .input-group-link-parent .selectize-dropdown-content {
    max-height: 300px !important;
    overflow-y: auto !important;
}

/* Warehouse detail - full width (no side panel) */
.detail[data-scope="Warehouse"] .record-grid {
    grid-template-columns: 1fr !important;
}

.detail[data-scope="Warehouse"] .record-grid > .side {
    display: none !important;
}

.detail[data-scope="Warehouse"] .record-grid > .left {
    width: 100% !important;
    min-width: 0 !important;
}

/* AutomaticInvoice create/edit - move side fields into form and use full width */
.edit[data-scope="AutomaticInvoice"] .record-grid {
    grid-template-columns: 1fr !important;
}

.edit[data-scope="AutomaticInvoice"] .record-grid > .side {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    margin-top: 16px;
}

.edit[data-scope="AutomaticInvoice"] .record-grid > .left {
    width: 100% !important;
    min-width: 0 !important;
}

/* Warehouse items panel - hide Project column */
.detail[data-scope="Warehouse"] th[data-name="project"],
.detail[data-scope="Warehouse"] td[data-name="project"] {
    display: none !important;
}

/* Warehouse items panel - layout baseline */
.detail[data-scope="Warehouse"] .bottom {
    min-width: 0 !important;
}

.detail[data-scope="Warehouse"] .panel-items .panel-body {
    /* Sticky table header breaks if ancestor has hidden overflow. */
    overflow: visible !important;
}

.detail[data-scope="Warehouse"] .panel-items .list-container {
    max-height: calc(100vh - 220px);
    overflow: auto !important;
}

.detail[data-scope="Warehouse"] .panel-items table.table {
    table-layout: fixed;
    width: 100%;
    max-width: 100%;
}

.detail[data-scope="Warehouse"] .panel-items table.table th,
.detail[data-scope="Warehouse"] .panel-items table.table td {
    font-size: 12px;
    padding: 6px 6px;
}

.detail[data-scope="Warehouse"] .panel-items th {
    white-space: normal;
    line-height: 1.2;
}

/* Warehouse items - header visuals (sticky behavior is handled by global clone script). */
.detail[data-scope="Warehouse"] .panel-items .list-container table.table > thead > tr > th {
    position: sticky !important;
    top: 0 !important;
    z-index: 80;
    background-color: #6f8298;
    color: #fff;
}

.detail[data-scope="Warehouse"] .panel-items .list-container table.table > thead > tr > th.checkbox-cell {
    z-index: 81;
}

/* Warehouse items - make row-selection checkboxes easier to see/click */
.detail[data-scope="Warehouse"] .panel-items .list-container table.table > thead > tr > th.checkbox-cell,
.detail[data-scope="Warehouse"] .panel-items .list-container table.table > tbody > tr > td:first-child {
    width: 38px;
    min-width: 38px;
    padding-left: 11px;
    padding-right: 6px;
}

.detail[data-scope="Warehouse"] .panel-items .list-container table.table > thead > tr > th.checkbox-cell input[type="checkbox"],
.detail[data-scope="Warehouse"] .panel-items .list-container table.table > tbody > tr > td:first-child input[type="checkbox"] {
    transform: scale(1.18);
    margin: 0;
}

/* Warehouse items - column widths (percentage, fit to screen) */
.detail[data-scope="Warehouse"] th[data-name="product"],
.detail[data-scope="Warehouse"] td[data-name="product"] {
    width: 13%;
}

.detail[data-scope="Warehouse"] th[data-name="batchNumber"],
.detail[data-scope="Warehouse"] td[data-name="batchNumber"] {
    width: 6%;
}

.detail[data-scope="Warehouse"] th[data-name="quantity"],
.detail[data-scope="Warehouse"] td[data-name="quantity"] {
    width: 4%;
}

.detail[data-scope="Warehouse"] th[data-name="cOrderCode"],
.detail[data-scope="Warehouse"] td[data-name="cOrderCode"] {
    width: 8%;
}

.detail[data-scope="Warehouse"] th[data-name="cOrderNumber"],
.detail[data-scope="Warehouse"] td[data-name="cOrderNumber"] {
    width: 8%;
}

.detail[data-scope="Warehouse"] th[data-name="stockedAt"],
.detail[data-scope="Warehouse"] td[data-name="stockedAt"] {
    width: 7%;
}

.detail[data-scope="Warehouse"] th[data-name="expiryDate"],
.detail[data-scope="Warehouse"] td[data-name="expiryDate"] {
    width: 6%;
}

.detail[data-scope="Warehouse"] th[data-name="cReturnDate"],
.detail[data-scope="Warehouse"] td[data-name="cReturnDate"] {
    width: 6%;
}

.detail[data-scope="Warehouse"] th[data-name="cDeliveryNoteSupplier"],
.detail[data-scope="Warehouse"] td[data-name="cDeliveryNoteSupplier"] {
    width: 8%;
}

.detail[data-scope="Warehouse"] th[data-name="cDeliveryNoteCompany"],
.detail[data-scope="Warehouse"] td[data-name="cDeliveryNoteCompany"] {
    width: 8%;
}

.detail[data-scope="Warehouse"] th[data-name="cDeliveryNote"],
.detail[data-scope="Warehouse"] td[data-name="cDeliveryNote"] {
    width: 7%;
}

.detail[data-scope="Warehouse"] th[data-name="cCreditNoteNumber"],
.detail[data-scope="Warehouse"] td[data-name="cCreditNoteNumber"] {
    width: 6%;
}

.detail[data-scope="Warehouse"] th[data-name="cGoodsReceiptNumber"],
.detail[data-scope="Warehouse"] td[data-name="cGoodsReceiptNumber"] {
    width: 7%;
}

/* Warehouse items - position column (Positional layout) */
.detail[data-scope="Warehouse"] th[data-name="position"],
.detail[data-scope="Warehouse"] td[data-name="position"] {
    width: 5%;
}

/* Warehouse items - row highlighting for expiring returnable materials */
.detail[data-scope="Warehouse"] .panel-items tr.row-expiry-warning > td {
    background-color: #fff9c4 !important;
}

.detail[data-scope="Warehouse"] .panel-items tr.row-expiry-overdue > td {
    background-color: #ffccbc !important;
}

/* Warehouse items - dropdown z-index fixes */
.detail[data-scope="Warehouse"] .panel-items .selectize-dropdown,
.detail[data-scope="Warehouse"] .panel-items .dropdown-menu {
    z-index: 1100 !important;
    position: absolute !important;
}

.detail[data-scope="Warehouse"] .panel-items td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail[data-scope="Warehouse"] .panel-items td[data-name="cOrderCode"] {
    overflow: visible;
    text-overflow: clip;
}

.detail[data-scope="Warehouse"] .panel-items td:focus-within,
.detail[data-scope="Warehouse"] .panel-items td.cell:has(.selectize-input.dropdown-active) {
    overflow: visible !important;
}

/* Warehouse items - Excel-like column filter arrow */
.detail[data-scope="Warehouse"] .column-filter-btn {
    display: inline;
    cursor: pointer;
    color: #fff;
    font-size: 20px;
    margin-left: 3px;
    vertical-align: middle;
}

.detail[data-scope="Warehouse"] .column-filter-btn:hover {
    color: #333;
}

.detail[data-scope="Warehouse"] .column-filter-btn.filter-active {
    color: #337ab7;
    font-weight: bold;
}

/* Project easement list - Excel-like column filter arrow */
[data-scope="Project"] .project-filterable-column {
    position: relative;
    padding-right: 22px !important;
}

[data-scope="Project"] .project-column-filter-btn {
    display: inline-block;
    position: absolute;
    right: 3px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    margin-left: 0;
    vertical-align: baseline;
    user-select: none;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
}

[data-scope="Project"] .project-column-filter-btn:hover {
    color: #fff;
    opacity: 1;
}

[data-scope="Project"] .project-column-filter-btn.filter-active {
    color: #fff;
    text-shadow: 0 0 3px rgba(51, 122, 183, 0.9), 0 1px 1px rgba(0, 0, 0, 0.45);
}

/* Filter dropdown panel - fixed positioning to escape overflow */
.warehouse-filter-dropdown,
.project-filter-dropdown {
    position: fixed;
    z-index: 1200;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 220px;
    font-size: 13px;
    font-weight: normal;
    white-space: normal;
}

.warehouse-filter-dropdown .filter-dropdown-search,
.project-filter-dropdown .filter-dropdown-search {
    padding: 6px;
    border-bottom: 1px solid #eee;
}

.warehouse-filter-dropdown .filter-search-input,
.project-filter-dropdown .filter-search-input {
    width: 100%;
    height: 26px;
    font-size: 12px;
    padding: 2px 6px;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-sizing: border-box;
}

.warehouse-filter-dropdown .filter-search-input:focus,
.project-filter-dropdown .filter-search-input:focus {
    border-color: #66afe9;
    outline: none;
}

.warehouse-filter-dropdown .filter-dropdown-actions,
.project-filter-dropdown .filter-dropdown-actions {
    padding: 3px 8px;
    font-size: 11px;
    border-bottom: 1px solid #eee;
    color: #555;
}

.warehouse-filter-dropdown .filter-dropdown-actions a,
.project-filter-dropdown .filter-dropdown-actions a {
    text-decoration: none;
    color: #337ab7;
}

.warehouse-filter-dropdown .filter-dropdown-list,
.project-filter-dropdown .filter-dropdown-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 2px 0;
}

.warehouse-filter-dropdown .filter-dropdown-item,
.project-filter-dropdown .filter-dropdown-item {
    display: block;
    padding: 2px 8px;
    cursor: pointer;
    font-weight: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.6;
}

.warehouse-filter-dropdown .filter-dropdown-item:hover,
.project-filter-dropdown .filter-dropdown-item:hover {
    background: #f0f5ff;
}

.warehouse-filter-dropdown .filter-dropdown-item input[type="checkbox"],
.project-filter-dropdown .filter-dropdown-item input[type="checkbox"] {
    margin-right: 4px;
    vertical-align: middle;
}

.warehouse-filter-dropdown .filter-dropdown-footer,
.project-filter-dropdown .filter-dropdown-footer {
    padding: 5px 6px;
    border-top: 1px solid #eee;
    text-align: right;
}

.warehouse-filter-dropdown .filter-dropdown-footer .btn,
.project-filter-dropdown .filter-dropdown-footer .btn {
    min-width: 55px;
    font-size: 12px;
}

/* Undo/Redo buttons for attendance table */
.field[data-name="attendances"] .btn-undo,
.field[data-name="attendances"] .btn-redo {
    margin-left: 4px;
    opacity: 1;
    transition: opacity 0.15s;
}

.field[data-name="attendances"] .btn-undo:disabled,
.field[data-name="attendances"] .btn-redo:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* EasementOwnerRecord - fit label badges and allow dropdown overflow */
.field[data-name="easementOwnerRecords"] table.table td .label {
    white-space: normal !important;
    word-break: break-word;
    display: inline-block;
    max-width: 100%;
    line-height: 1.3;
    font-size: 11px;
    padding: 3px 6px;
}
.field[data-name="easementOwnerRecords"] table.table th {
    white-space: normal !important;
    font-size: 11px;
    line-height: 1.2;
}
.field[data-name="easementOwnerRecords"],
.field[data-name="easementOwnerRecords"] div:not(.selectize-dropdown):not(.selectize-dropdown-content) {
    overflow: visible !important;
}
.field[data-name="easementOwnerRecords"] .selectize-dropdown-content {
    max-height: 200px !important;
    overflow-y: auto !important;
}
.field[data-name="easementOwnerRecords"] .selectize-dropdown {
    position: absolute !important;
    z-index: 1060 !important;
}

/* Always show inline-edit pencil icons on detail/view (not only on hover) — excludes list views */
.record .cell > .inline-edit-link.hidden {
    display: inline-block !important;
    opacity: 0.3;
}
.record .cell:hover > .inline-edit-link.hidden {
    opacity: 1;
}

/* Header buttons - wrap instead of overflow */
.page-header-row {
    flex-wrap: wrap;
}

.page-header-column-2 {
    min-width: 0;
    max-width: 100%;
    overflow: visible;
}

.header-buttons.btn-group {
    float: none !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px;
    justify-content: flex-end;
}

.header-buttons.btn-group > .btn,
.header-buttons.btn-group > .btn-group {
    float: none !important;
}

[data-scope="ReceivedProformaInvoice"] .page-header-row,
[data-scope="ReceivedProformaInvoice"] .page-header-column-2 {
    justify-content: flex-end;
    text-align: right;
}

[data-scope="ReceivedProformaInvoice"] .header-buttons.btn-group {
    margin-left: auto;
    justify-content: flex-end !important;
}

/* Detail view record buttons - wrap */
.detail-button-container .btn-group.actions-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.detail-button-container .btn-group.actions-btn-group > .btn {
    float: none;
}

.detail-button-container .btn-group.actions-btn-group > .btn + .btn,
.detail-button-container .btn-group.actions-btn-group > .btn + .btn-group,
.detail-button-container .btn-group.actions-btn-group > .btn-group + .btn {
    margin-left: 0;
}

/* Project list - give the main text search more room. */
.project-list-search-container .search-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
}

.project-list-search-container .search-row > .form-group:first-child {
    float: none;
    flex: 1 1 720px;
    width: auto;
    max-width: calc(100% - 120px);
}

.project-list-search-container .search-row > .form-group:nth-child(2) {
    float: none;
    flex: 0 0 auto;
    width: auto;
}

.project-list-search-container .text-filter {
    min-width: 420px;
}

@media (max-width: 767px) {
    .project-list-search-container .search-row > .form-group:first-child,
    .project-list-search-container .search-row > .form-group:nth-child(2) {
        flex-basis: 100%;
        max-width: 100%;
        width: 100%;
    }

    .project-list-search-container .text-filter {
        min-width: 0;
    }
}

/* Hide edit (pencil) button on main list views */
.list-container > .list .list-row-buttons .edit-row-btn {
    display: none !important;
}

/* Show edit (pencil) button on detail panels */
.panel .list-row-buttons {
    overflow: visible !important;
    white-space: nowrap;
    display: inline-flex !important;
    align-items: center;
    visibility: visible !important;
    opacity: 1 !important;
}
.panel .list-row-buttons .edit-row-btn {
    padding: 2px 4px;
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-block !important;
}
.panel .list-row-buttons .action {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    padding: 0 2px !important;
}
.panel .list-row-buttons .action .fas,
.panel .list-row-buttons .action .far,
.panel .list-row-buttons .action .fa {
    display: inline-block !important;
    font-size: 13px !important;
    line-height: 1 !important;
}
.panel td:has(.list-row-buttons),
.panel td.cell[data-name="buttonsField"] {
    overflow: visible !important;
    width: 50px !important;
    min-width: 50px !important;
}

/* DriveLog trips panel - bigger arrow without boxed button */
.panel[data-name="driveLogTrips"] td.cell[data-name="buttonsField"],
.panel[data-name="driveLogTrips"] td:has(.list-row-buttons) {
    width: 48px !important;
    min-width: 48px !important;
}

.detail[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="split-button"],
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] td[data-name="split-button"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="split-button"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] td[data-name="split-button"],
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] th[data-name="split-button"],
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td[data-name="split-button"],
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] th[data-name="split-button"],
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td[data-name="split-button"] {
    width: 110px !important;
    min-width: 110px !important;
}

.detail[data-scope="SupplierInvoice"] .field[data-name="items"] .split-item-action,
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] .split-item-action,
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] .split-item-action,
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] .split-item-action {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 96px !important;
    padding: 4px 10px !important;
    white-space: nowrap;
}

.panel[data-name="driveLogTrips"] .list-row-buttons > .dropdown-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    min-height: 22px;
    padding: 0 4px !important;
    border: 0 !important;
    border-radius: 3px;
    background: transparent !important;
    color: #1f2a37 !important;
    box-shadow: none !important;
    opacity: 1 !important;
}

.panel[data-name="driveLogTrips"] .list-row-buttons > .dropdown-toggle .caret {
    border-top-width: 8px;
    border-right-width: 6px;
    border-left-width: 6px;
    border-top-style: solid;
    margin-top: 0;
}

.panel[data-name="driveLogTrips"] .list-row-buttons > .dropdown-toggle:hover,
.panel[data-name="driveLogTrips"] .list-row-buttons > .dropdown-toggle:focus {
    background: #edf2f7 !important;
}

/* Dropzone - drag & drop file upload */
.dropzone-container {
    padding: 10px;
}

.dropzone-area {
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropzone-area:hover {
    border-color: #999;
    background-color: #fafafa;
}

.dropzone-highlight,
.dropzone-area.dropzone-highlight {
    border-color: #2980b9 !important;
    background-color: #ebf5fb !important;
}

.dropzone-icon {
    font-size: 48px;
    color: #bbb;
    display: block;
    margin-bottom: 12px;
}

.dropzone-text {
    font-size: 16px;
    color: #555;
    margin-bottom: 6px;
    font-weight: 500;
}

.dropzone-subtext {
    font-size: 13px;
    color: #999;
    margin-bottom: 10px;
}

.dropzone-hint {
    font-size: 11px;
    color: #aaa;
    margin-top: 12px;
}

.dropzone-browse-btn {
    cursor: pointer;
}

.dropzone-success .dropzone-icon {
    color: #27ae60;
}

.dropzone-filename {
    font-weight: 600;
    color: #333;
    word-break: break-all;
}

/* Invoice items (issued advance invoices share them, SUP-2583): compact row editor to reduce horizontal scrolling */
.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] .recordList,
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] .recordList {
    overflow-x: hidden !important;
    overflow-y: visible !important;
}

.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] .list > table.table,
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] .list > table.table,
.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] table.table,
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] table.table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    min-width: 0 !important;
}

.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] .list > table.table > thead > tr > th,
.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] .list > table.table > tbody > tr > td,
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] .list > table.table > thead > tr > th,
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] .list > table.table > tbody > tr > td {
    padding: 3px 2px !important;
    font-size: 12px !important;
}

.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell .cell-wrapper,
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell .cell-wrapper {
    min-width: 0 !important;
}

.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="name"] input.form-control,
.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="name"] textarea.form-control,
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="name"] input.form-control,
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="name"] textarea.form-control {
    width: 100% !important;
    min-width: 0 !important;
}

.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="quantityUnit"],
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="quantityUnit"] {
    overflow: visible !important;
    position: relative !important;
    z-index: 2000 !important;
}

.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="quantityUnit"]:focus-within,
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="quantityUnit"]:focus-within {
    z-index: 10000 !important;
}

.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="quantityUnit"] .cell-wrapper,
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="quantityUnit"] .cell-wrapper {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: visible !important;
}

.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="quantityUnit"] .selectize-control,
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="quantityUnit"] .selectize-control {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: visible !important;
}

.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="quantityUnit"] .selectize-dropdown,
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="quantityUnit"] .selectize-dropdown {
    left: 0 !important;
    right: auto !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    max-height: 220px !important;
    z-index: 10001 !important;
}

.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="quantityUnit"] .selectize-dropdown .option,
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="quantityUnit"] .selectize-dropdown .option {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="quantityUnit"] select.main-element,
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="quantityUnit"] select.main-element,
.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="quantityUnit"] input.main-element,
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="quantityUnit"] input.main-element {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="unitPrice"] .input-group-currency,
.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="amount"] .input-group-currency,
.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="amountWithTax"] .input-group-currency,
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="unitPrice"] .input-group-currency,
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="amount"] .input-group-currency,
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="amountWithTax"] .input-group-currency {
    width: 100% !important;
    max-width: 88px !important;
}

.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="unitPrice"] input.main-element,
.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="amount"] input.main-element,
.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="amountWithTax"] input.main-element,
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="unitPrice"] input.main-element,
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="amount"] input.main-element,
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="amountWithTax"] input.main-element {
    width: 100% !important;
    min-width: 0 !important;
}

.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] th[data-name="remove-cross"],
.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] th[data-name="sort-magnet"],
.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] th[data-name="duplicate"],
.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td[data-name="remove-cross"],
.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td[data-name="sort-magnet"],
.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td[data-name="duplicate"],
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] th[data-name="remove-cross"],
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] th[data-name="sort-magnet"],
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] th[data-name="duplicate"],
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td[data-name="remove-cross"],
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td[data-name="sort-magnet"],
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td[data-name="duplicate"] {
    width: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td[data-name="remove-cross"] .btn,
.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td[data-name="sort-magnet"] .btn,
.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td[data-name="duplicate"] .btn,
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td[data-name="remove-cross"] .btn,
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td[data-name="sort-magnet"] .btn,
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td[data-name="duplicate"] .btn {
    padding: 0 !important;
    min-width: 16px !important;
    min-height: 16px !important;
}

.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] th[data-name="name"],
.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="name"],
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] th[data-name="name"],
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="name"],
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="name"],
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] td.cell[data-name="name"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="name"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] td.cell[data-name="name"],
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] th[data-name="name"],
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td.cell[data-name="name"],
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] th[data-name="name"],
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td.cell[data-name="name"] {
    min-width: 0 !important;
    width: 27% !important;
}

.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] th[data-name="quantity"],
.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="quantity"],
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] th[data-name="quantity"],
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="quantity"],
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="quantity"],
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] td.cell[data-name="quantity"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="quantity"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] td.cell[data-name="quantity"],
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] th[data-name="quantity"],
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td.cell[data-name="quantity"],
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] th[data-name="quantity"],
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td.cell[data-name="quantity"] {
    width: 5% !important;
    min-width: 72px !important;
    white-space: nowrap !important;
}

.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] th[data-name="itemParent"],
.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="itemParent"],
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] th[data-name="itemParent"],
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td.cell[data-name="itemParent"],
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="itemParent"],
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] td.cell[data-name="itemParent"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="itemParent"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] td.cell[data-name="itemParent"],
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] th[data-name="itemParent"],
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td.cell[data-name="itemParent"],
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] th[data-name="itemParent"],
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td.cell[data-name="itemParent"] {
    min-width: 0 !important;
    width: 8% !important;
}

.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) td.cell[data-name="itemParent"] .input-group-item:first-child,
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) td.cell[data-name="itemParent"] .input-group-item:first-child,
.detail[data-scope="SupplierInvoice"] td.cell[data-name="itemParent"] .input-group-item:first-child,
.edit[data-scope="SupplierInvoice"] td.cell[data-name="itemParent"] .input-group-item:first-child,
.detail[data-scope="ReceivedTaxDocument"] td.cell[data-name="itemParent"] .input-group-item:first-child,
.edit[data-scope="ReceivedTaxDocument"] td.cell[data-name="itemParent"] .input-group-item:first-child {
    min-width: 84px !important;
    max-width: 96px !important;
    flex: 0 0 96px !important;
}

.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) td.cell[data-name="itemParent"] .input-group-item-middle,
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) td.cell[data-name="itemParent"] .input-group-item-middle,
.detail[data-scope="SupplierInvoice"] td.cell[data-name="itemParent"] .input-group-item-middle,
.edit[data-scope="SupplierInvoice"] td.cell[data-name="itemParent"] .input-group-item-middle,
.detail[data-scope="ReceivedTaxDocument"] td.cell[data-name="itemParent"] .input-group-item-middle,
.edit[data-scope="ReceivedTaxDocument"] td.cell[data-name="itemParent"] .input-group-item-middle {
    min-width: 0 !important;
}

/* Invoice-family: keep itemParent control inside cell (no leaking behind backgrounds). */
.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) td.cell[data-name="itemParent"] .input-group-link-parent,
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) td.cell[data-name="itemParent"] .input-group-link-parent,
.detail[data-scope="SupplierInvoice"] td.cell[data-name="itemParent"] .input-group-link-parent,
.edit[data-scope="SupplierInvoice"] td.cell[data-name="itemParent"] .input-group-link-parent,
.detail[data-scope="ReceivedTaxDocument"] td.cell[data-name="itemParent"] .input-group-link-parent,
.edit[data-scope="ReceivedTaxDocument"] td.cell[data-name="itemParent"] .input-group-link-parent {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
}

.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) td.cell[data-name="itemParent"] .input-group-item-middle,
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) td.cell[data-name="itemParent"] .input-group-item-middle,
.detail[data-scope="SupplierInvoice"] td.cell[data-name="itemParent"] .input-group-item-middle,
.edit[data-scope="SupplierInvoice"] td.cell[data-name="itemParent"] .input-group-item-middle,
.detail[data-scope="ReceivedTaxDocument"] td.cell[data-name="itemParent"] .input-group-item-middle,
.edit[data-scope="ReceivedTaxDocument"] td.cell[data-name="itemParent"] .input-group-item-middle {
    overflow: hidden !important;
}

.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) td.cell[data-name="itemParent"] .input-group-item-middle .form-control,
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) td.cell[data-name="itemParent"] .input-group-item-middle .form-control,
.detail[data-scope="SupplierInvoice"] td.cell[data-name="itemParent"] .input-group-item-middle .form-control,
.edit[data-scope="SupplierInvoice"] td.cell[data-name="itemParent"] .input-group-item-middle .form-control,
.detail[data-scope="ReceivedTaxDocument"] td.cell[data-name="itemParent"] .input-group-item-middle .form-control,
.edit[data-scope="ReceivedTaxDocument"] td.cell[data-name="itemParent"] .input-group-item-middle .form-control,
.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) td.cell[data-name="itemParent"] .input-group-item-middle .link-group-container,
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) td.cell[data-name="itemParent"] .input-group-item-middle .link-group-container,
.detail[data-scope="SupplierInvoice"] td.cell[data-name="itemParent"] .input-group-item-middle .link-group-container,
.edit[data-scope="SupplierInvoice"] td.cell[data-name="itemParent"] .input-group-item-middle .link-group-container,
.detail[data-scope="ReceivedTaxDocument"] td.cell[data-name="itemParent"] .input-group-item-middle .link-group-container,
.edit[data-scope="ReceivedTaxDocument"] td.cell[data-name="itemParent"] .input-group-item-middle .link-group-container,
.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) td.cell[data-name="itemParent"] .input-group-item-middle .link-group-container .link,
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) td.cell[data-name="itemParent"] .input-group-item-middle .link-group-container .link,
.detail[data-scope="SupplierInvoice"] td.cell[data-name="itemParent"] .input-group-item-middle .link-group-container .link,
.edit[data-scope="SupplierInvoice"] td.cell[data-name="itemParent"] .input-group-item-middle .link-group-container .link,
.detail[data-scope="ReceivedTaxDocument"] td.cell[data-name="itemParent"] .input-group-item-middle .link-group-container .link,
.edit[data-scope="ReceivedTaxDocument"] td.cell[data-name="itemParent"] .input-group-item-middle .link-group-container .link {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* Invoice-family items - compact price columns for one-line readability */
.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] th[data-name="unitPrice"],
.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] th[data-name="taxRate"],
.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] th[data-name="amount"],
.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] th[data-name="taxAmount"],
.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] th[data-name="amountWithTax"],
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] th[data-name="unitPrice"],
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] th[data-name="taxRate"],
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] th[data-name="amount"],
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] th[data-name="taxAmount"],
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] th[data-name="amountWithTax"],
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="unitPrice"],
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="taxRate"],
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="amount"],
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="taxAmount"],
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="amountWithTax"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="unitPrice"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="taxRate"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="amount"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="taxAmount"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="amountWithTax"],
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] th[data-name="unitPrice"],
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] th[data-name="taxRate"],
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] th[data-name="amount"],
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] th[data-name="taxAmount"],
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] th[data-name="amountWithTax"],
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] th[data-name="unitPrice"],
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] th[data-name="taxRate"],
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] th[data-name="amount"],
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] th[data-name="taxAmount"],
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] th[data-name="amountWithTax"] {
    white-space: nowrap !important;
}

.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td[data-name="unitPrice"],
.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td[data-name="taxRate"],
.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td[data-name="amount"],
.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td[data-name="taxAmount"],
.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td[data-name="amountWithTax"],
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td[data-name="unitPrice"],
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td[data-name="taxRate"],
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td[data-name="amount"],
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td[data-name="taxAmount"],
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td[data-name="amountWithTax"],
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] td[data-name="unitPrice"],
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] td[data-name="taxRate"],
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] td[data-name="amount"],
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] td[data-name="taxAmount"],
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] td[data-name="amountWithTax"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] td[data-name="unitPrice"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] td[data-name="taxRate"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] td[data-name="amount"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] td[data-name="taxAmount"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] td[data-name="amountWithTax"],
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td[data-name="unitPrice"],
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td[data-name="taxRate"],
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td[data-name="amount"],
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td[data-name="taxAmount"],
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td[data-name="amountWithTax"],
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td[data-name="unitPrice"],
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td[data-name="taxRate"],
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td[data-name="amount"],
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td[data-name="taxAmount"],
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td[data-name="amountWithTax"] {
    white-space: nowrap !important;
}

.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] th[data-name="taxRate"],
.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td[data-name="taxRate"],
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] th[data-name="taxRate"],
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td[data-name="taxRate"],
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="taxRate"],
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] td[data-name="taxRate"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="taxRate"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] td[data-name="taxRate"],
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] th[data-name="taxRate"],
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td[data-name="taxRate"],
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] th[data-name="taxRate"],
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td[data-name="taxRate"] {
    width: 6% !important;
    min-width: 54px !important;
}

/* Automatic invoice items: VAT is a choice, not a secondary number.
   Give its native select enough room and a clear focus/reading contrast. */
.edit[data-scope="AutomaticInvoice"] .field[data-name="items"] th[data-name="taxRate"],
.edit[data-scope="AutomaticInvoice"] .field[data-name="items"] td[data-name="taxRate"] {
    width: 9% !important;
    min-width: 92px !important;
    background: #eff6ff !important;
}

.edit[data-scope="AutomaticInvoice"] .field[data-name="items"] select.tax-rate-dropdown {
    width: 100% !important;
    min-width: 92px !important;
    height: 34px !important;
    padding: 6px 26px 6px 8px !important;
    border: 1px solid #53779d !important;
    background-color: #ffffff !important;
    color: #0f172a !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
}

.edit[data-scope="AutomaticInvoice"] .field[data-name="items"] select.tax-rate-dropdown:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .18) !important;
}

.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] th[data-name="taxAmount"],
.detail:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td[data-name="taxAmount"],
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] th[data-name="taxAmount"],
.edit:is([data-scope="Invoice"], [data-scope="ProformaInvoice"]) .field[data-name="items"] td[data-name="taxAmount"],
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="taxAmount"],
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] td[data-name="taxAmount"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="taxAmount"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] td[data-name="taxAmount"],
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] th[data-name="taxAmount"],
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td[data-name="taxAmount"],
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] th[data-name="taxAmount"],
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td[data-name="taxAmount"] {
    width: 9% !important;
    min-width: 84px !important;
}

/* SupplierInvoice items: keep Item Code column visible. */
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="cItemCode"],
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] td.cell[data-name="cItemCode"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="cItemCode"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] td.cell[data-name="cItemCode"] {
    width: 6% !important;
    min-width: 60px !important;
    max-width: 90px !important;
    display: table-cell !important;
}

/* SupplierInvoice/ReceivedTaxDocument items:
   compact font + strict 100% table width (no wider), while keeping name and parent readable. */
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] .recordList,
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] .recordList,
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] .recordList,
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] .recordList,
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] .list-container,
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] .list-container,
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] .list-container,
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] .list-container,
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] .recordList > .list,
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] .recordList > .list,
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] .recordList > .list,
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] .recordList > .list {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
}

.detail[data-scope="SupplierInvoice"] .field[data-name="items"] table.table,
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] table.table,
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] table.table,
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] table.table {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
}

.detail[data-scope="SupplierInvoice"] .field[data-name="items"] table.table thead th,
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] table.table thead th,
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] table.table thead th,
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] table.table thead th,
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] table.table tbody td,
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] table.table tbody td,
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] table.table tbody td,
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] table.table tbody td {
    font-size: 10px !important;
    line-height: 1.2 !important;
    padding: 3px 4px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.detail[data-scope="SupplierInvoice"] .field[data-name="items"] .form-control,
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] .form-control,
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] .form-control,
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] .form-control,
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] .selectize-input,
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] .selectize-input,
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] .selectize-input,
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] .selectize-input {
    font-size: 10px !important;
    line-height: 1.2 !important;
}

.detail[data-scope="SupplierInvoice"] .field[data-name="items"] table.table thead th,
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] table.table thead th,
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] table.table thead th,
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] table.table thead th {
    vertical-align: bottom !important;
}

/* Priority columns: keep readable. */
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="name"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="name"],
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] th[data-name="name"],
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] th[data-name="name"],
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] td.cell[data-name="name"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] td.cell[data-name="name"],
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td.cell[data-name="name"],
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td.cell[data-name="name"] {
    width: 22% !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

.detail[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="itemParent"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="itemParent"],
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] th[data-name="itemParent"],
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] th[data-name="itemParent"],
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] td.cell[data-name="itemParent"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] td.cell[data-name="itemParent"],
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td.cell[data-name="itemParent"],
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td.cell[data-name="itemParent"] {
    width: 21% !important;
    min-width: 0 !important;
    white-space: normal !important;
    overflow: visible !important;
}

/* Secondary compact widths. */
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="noteNumber"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="noteNumber"],
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] th[data-name="noteNumber"],
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] th[data-name="noteNumber"],
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] td[data-name="noteNumber"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] td[data-name="noteNumber"],
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td[data-name="noteNumber"],
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td[data-name="noteNumber"] {
    width: 6% !important;
}

.detail[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="citemBatch"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="citemBatch"],
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] th[data-name="citemBatch"],
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] th[data-name="citemBatch"],
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] td[data-name="citemBatch"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] td[data-name="citemBatch"],
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td[data-name="citemBatch"],
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td[data-name="citemBatch"] {
    width: 6% !important;
}

.detail[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="cexpirationDate"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="cexpirationDate"],
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] th[data-name="cexpirationDate"],
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] th[data-name="cexpirationDate"],
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] td[data-name="cexpirationDate"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] td[data-name="cexpirationDate"],
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td[data-name="cexpirationDate"],
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td[data-name="cexpirationDate"] {
    width: 7% !important;
}

.detail[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="isReturnable"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] th[data-name="isReturnable"],
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] th[data-name="isReturnable"],
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] th[data-name="isReturnable"],
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] td[data-name="isReturnable"],
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] td[data-name="isReturnable"],
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td[data-name="isReturnable"],
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td[data-name="isReturnable"] {
    width: 4% !important;
}

/* Keep itemParent editor compact but readable. */
.detail[data-scope="SupplierInvoice"] td.cell[data-name="itemParent"] .input-group-link-parent,
.edit[data-scope="SupplierInvoice"] td.cell[data-name="itemParent"] .input-group-link-parent,
.detail[data-scope="ReceivedTaxDocument"] td.cell[data-name="itemParent"] .input-group-link-parent,
.edit[data-scope="ReceivedTaxDocument"] td.cell[data-name="itemParent"] .input-group-link-parent {
    display: flex !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
}

.detail[data-scope="SupplierInvoice"] td.cell[data-name="itemParent"] .input-group-item:first-child,
.edit[data-scope="SupplierInvoice"] td.cell[data-name="itemParent"] .input-group-item:first-child,
.detail[data-scope="ReceivedTaxDocument"] td.cell[data-name="itemParent"] .input-group-item:first-child,
.edit[data-scope="ReceivedTaxDocument"] td.cell[data-name="itemParent"] .input-group-item:first-child {
    min-width: 78px !important;
    flex: 0 0 78px !important;
}

.detail[data-scope="SupplierInvoice"] td.cell[data-name="itemParent"] .input-group-item-middle,
.edit[data-scope="SupplierInvoice"] td.cell[data-name="itemParent"] .input-group-item-middle,
.detail[data-scope="ReceivedTaxDocument"] td.cell[data-name="itemParent"] .input-group-item-middle,
.edit[data-scope="ReceivedTaxDocument"] td.cell[data-name="itemParent"] .input-group-item-middle {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

.detail[data-scope="SupplierInvoice"] .field[data-name="items"] .selectize-dropdown,
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] .dropdown-menu,
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] .select2-drop,
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] .autocomplete-suggestions,
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] .selectize-dropdown,
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] .dropdown-menu,
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] .select2-drop,
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] .autocomplete-suggestions,
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] .selectize-dropdown,
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] .dropdown-menu,
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] .select2-drop,
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] .autocomplete-suggestions,
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] .selectize-dropdown,
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] .dropdown-menu,
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] .select2-drop,
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] .autocomplete-suggestions {
    z-index: 1100 !important;
    position: absolute !important;
}

.detail[data-scope="SupplierInvoice"] .field[data-name="items"] .selectize-input.dropdown-active,
.detail[data-scope="SupplierInvoice"] .field[data-name="items"] td.cell:focus-within,
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] .selectize-input.dropdown-active,
.edit[data-scope="SupplierInvoice"] .field[data-name="items"] td.cell:focus-within,
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] .selectize-input.dropdown-active,
.detail[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td.cell:focus-within,
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] .selectize-input.dropdown-active,
.edit[data-scope="ReceivedTaxDocument"] .field[data-name="items"] td.cell:focus-within {
    z-index: 1050 !important;
    position: relative !important;
}

/* ReceivedProformaInvoice items: mirror SupplierInvoice item layout. */
.detail[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] .recordList,
.edit[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] .recordList,
.detail[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] .list-container,
.edit[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] .list-container,
.detail[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] .recordList > .list,
.edit[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] .recordList > .list {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
}

.detail[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] table.table,
.edit[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] table.table {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
}

.detail[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] table.table thead th,
.edit[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] table.table thead th,
.detail[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] table.table tbody td,
.edit[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] table.table tbody td {
    font-size: 10px !important;
    line-height: 1.2 !important;
    padding: 3px 4px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.detail[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] .form-control,
.edit[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] .form-control,
.detail[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] .selectize-input,
.edit[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] .selectize-input {
    font-size: 10px !important;
    line-height: 1.2 !important;
}

.detail[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] table.table thead th,
.edit[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] table.table thead th {
    vertical-align: bottom !important;
}

.detail[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] th[data-name="name"],
.edit[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] th[data-name="name"],
.detail[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] td.cell[data-name="name"],
.edit[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] td.cell[data-name="name"] {
    width: 22% !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

.detail[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] th[data-name="itemParent"],
.edit[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] th[data-name="itemParent"],
.detail[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] td.cell[data-name="itemParent"],
.edit[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] td.cell[data-name="itemParent"] {
    width: 21% !important;
    min-width: 0 !important;
    white-space: normal !important;
    overflow: visible !important;
}

.detail[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] th[data-name="noteNumber"],
.edit[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] th[data-name="noteNumber"],
.detail[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] td[data-name="noteNumber"],
.edit[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] td[data-name="noteNumber"] {
    width: 6% !important;
}

.detail[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] th[data-name="citemBatch"],
.edit[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] th[data-name="citemBatch"],
.detail[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] td[data-name="citemBatch"],
.edit[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] td[data-name="citemBatch"] {
    width: 6% !important;
}

.detail[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] th[data-name="cexpirationDate"],
.edit[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] th[data-name="cexpirationDate"],
.detail[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] td[data-name="cexpirationDate"],
.edit[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] td[data-name="cexpirationDate"] {
    width: 7% !important;
}

.detail[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] th[data-name="isReturnable"],
.edit[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] th[data-name="isReturnable"],
.detail[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] td[data-name="isReturnable"],
.edit[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] td[data-name="isReturnable"] {
    width: 4% !important;
}

.detail[data-scope="ReceivedProformaInvoice"] td.cell[data-name="itemParent"] .input-group-link-parent,
.edit[data-scope="ReceivedProformaInvoice"] td.cell[data-name="itemParent"] .input-group-link-parent {
    display: flex !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
}

.detail[data-scope="ReceivedProformaInvoice"] td.cell[data-name="itemParent"] .input-group-item:first-child,
.edit[data-scope="ReceivedProformaInvoice"] td.cell[data-name="itemParent"] .input-group-item:first-child {
    min-width: 78px !important;
    flex: 0 0 78px !important;
}

.detail[data-scope="ReceivedProformaInvoice"] td.cell[data-name="itemParent"] .input-group-item-middle,
.edit[data-scope="ReceivedProformaInvoice"] td.cell[data-name="itemParent"] .input-group-item-middle {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

.detail[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] .selectize-dropdown,
.detail[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] .dropdown-menu,
.detail[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] .select2-drop,
.detail[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] .autocomplete-suggestions,
.edit[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] .selectize-dropdown,
.edit[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] .dropdown-menu,
.edit[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] .select2-drop,
.edit[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] .autocomplete-suggestions {
    z-index: 1100 !important;
    position: absolute !important;
}

.detail[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] .selectize-input.dropdown-active,
.detail[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] td.cell:focus-within,
.edit[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] .selectize-input.dropdown-active,
.edit[data-scope="ReceivedProformaInvoice"] .field[data-name="items"] td.cell:focus-within {
    z-index: 1050 !important;
    position: relative !important;
}

/* Role permissions matrix - prevent enum fields from overlapping. */
.detail[data-scope="Role"] .panel-body > .no-margin,
.edit[data-scope="Role"] .panel-body > .no-margin,
.record[data-scope="Role"] .panel-body > .no-margin {
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
}

.detail[data-scope="Role"] table.scope-level,
.edit[data-scope="Role"] table.scope-level,
.record[data-scope="Role"] table.scope-level {
    min-width: 980px;
    table-layout: fixed;
}

.detail[data-scope="Role"] table.field-level,
.edit[data-scope="Role"] table.field-level,
.record[data-scope="Role"] table.field-level {
    min-width: 760px;
    table-layout: fixed;
}

.detail[data-scope="Role"] table.scope-level th:first-child,
.detail[data-scope="Role"] table.scope-level td:first-child,
.edit[data-scope="Role"] table.scope-level th:first-child,
.edit[data-scope="Role"] table.scope-level td:first-child,
.record[data-scope="Role"] table.scope-level th:first-child,
.record[data-scope="Role"] table.scope-level td:first-child {
    width: 25%;
}

.detail[data-scope="Role"] table.scope-level td,
.detail[data-scope="Role"] table.field-level td,
.edit[data-scope="Role"] table.scope-level td,
.edit[data-scope="Role"] table.field-level td,
.record[data-scope="Role"] table.scope-level td,
.record[data-scope="Role"] table.field-level td {
    overflow: visible !important;
    vertical-align: middle;
}

.detail[data-scope="Role"] table.scope-level .selectize-control,
.detail[data-scope="Role"] table.field-level .selectize-control,
.edit[data-scope="Role"] table.scope-level .selectize-control,
.edit[data-scope="Role"] table.field-level .selectize-control,
.record[data-scope="Role"] table.scope-level .selectize-control,
.record[data-scope="Role"] table.field-level .selectize-control {
    min-width: 92px;
    width: 100%;
}

.detail[data-scope="Role"] table.scope-level .selectize-input,
.detail[data-scope="Role"] table.field-level .selectize-input,
.edit[data-scope="Role"] table.scope-level .selectize-input,
.edit[data-scope="Role"] table.field-level .selectize-input,
.record[data-scope="Role"] table.scope-level .selectize-input,
.record[data-scope="Role"] table.field-level .selectize-input {
    min-height: 30px;
    white-space: nowrap;
}

/* Visible scrollbars in Firefox: the AutoERP theme sets scrollbar-width: none on every element
   (SUP-1824). Fixed in autocrm-themes !43; remove this rule once that release is installed. */
* {
    scrollbar-width: thin;
}
