.soh-table-container {
    box-sizing: border-box;
    width: 100%;
}

.soh-table-container-sm {
    max-width: 500px;
}

.soh-table-container-md {
    padding: 20px 20px 20px 0;
    max-width: 800px;
}

.soh-table-container-lg {
    padding: 20px 20px 20px 0;
    max-width: 920px;
}

.soh-table-container-xl {
    padding: 20px 20px 20px 0;
    max-width: 920px;
    overflow-x: auto;
}

.soh-table-scroll {
    overflow: hidden;
    border: 1px solid #cfd4da;
    border-radius: 6px;
    background-color: #fcfcfd;
}

.soh-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    color: #111827;
    background-color: #fcfcfd;
    border: 1px solid #cfd4da;
    border-radius: 6px;
    overflow: hidden;
}

.soh-table-scroll .soh-table {
    border: none;
    border-radius: 0;
    overflow: visible;
}

.soh-table-head th {
    padding: 10px 12px;
    text-align: center;
    font-weight: 600;
    color: #374151;
    background-color: #ececec;
    border-bottom: 1px solid #cfd4da;
}

.soh-table-title {
    font-size: 14px;
    color: #111827;
    background-color: #ececec;
    letter-spacing: 0.02em;
}

.soh-table-head tr:not(:first-child) th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #4b5563;
    border-bottom: 2px solid #c4cad1;
}

.soh-table-head tr:not(:first-child) th small {
    font-size: 10px;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

/* Scrolls only the rows, so the scrollbar never runs alongside the header. */
.soh-table-body-scroll,
.soh-table-body-scroll .soh-table-head,
.soh-table-body-scroll tbody {
    display: block;
}

.soh-table-body-scroll tbody {
    max-height: 340px;
    overflow-y: auto;
}

.soh-table-body-scroll tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}

.soh-table-row td {
    padding: 10px 12px;
    text-align: center;
    vertical-align: middle;
    border-bottom: 1px solid #e2e5e9;
}

.soh-table-compact .soh-table-row td {
    padding: 6px 10px;
}

.soh-table-row:last-child td {
    border-bottom: none;
}

.soh-table-row:hover td {
    background-color: #f1f3f5;
}

.soh-table-no-hover .soh-table-row:hover td {
    background-color: transparent;
}

.soh-table-empty {
    font-weight: 400;
    color: #6b7280;
}

.soh-table-note {
    padding: 10px 12px;
    text-align: left;
    font-size: 11px;
    font-style: italic;
    color: #6b7280;
    background-color: #f7f8fa;
    border-top: 1px solid #cfd4da;
}

.soh-table-fixed {
    table-layout: fixed;
}

.soh-table-nowrap {
    white-space: nowrap;
}

.soh-table-align-start {
    text-align: left;
    font-weight: 500;
}

.soh-table-col-icon {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
}

.soh-table-col-60 {
    width: 60px;
}

.soh-table-col-90 {
    width: 90px;
}

.soh-table-col-100 {
    width: 100px;
}

.soh-table-col-120 {
    width: 120px;
    max-width: 120px;
}

.soh-table-col-150 {
    width: 150px;
}

.soh-table-col-200 {
    width: 200px;
}

.soh-table-message-cell {
    text-align: left !important;
    width: auto;
    max-width: 0;
    overflow: hidden;
}

.soh-table-message {
    min-width: 0;
    max-width: 100%;
}

.soh-table-message summary {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    cursor: pointer;
    list-style: none;
}

.soh-table-message summary::-webkit-details-marker {
    display: none;
}

.soh-table-message summary::before {
    content: "▸";
    font-size: 16px;
    line-height: 1;
    color: #4b5563;
    transition: transform 0.15s ease;
}

.soh-table-message[open] summary::before {
    transform: rotate(90deg);
}

.soh-table-message-preview {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.soh-table-message-full {
    margin: 8px 0 2px 26px;
    padding: 8px;
    color: #374151;
    background-color: #fff;
    border: 1px solid #d7dbe0;
    border-radius: 4px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
    box-sizing: border-box;
}

.soh-table-icon {
    height: 20px;
    vertical-align: middle;
    margin-right: 5px;
}

.soh-table-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.soh-table-date {
    font-size: 11px;
    color: #4b5563;
    white-space: nowrap;
}

.soh-table-small {
    font-size: 12px;
}

.soh-table-adj-neg {
    color: #dc2626;
}

.soh-table-adj-pos {
    color: #16a34a;
}

.soh-table-checkbox .form-check-input {
    appearance: none;
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    border: 2px solid #b6bdc6;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    position: relative;
    transition: all 0.15s ease;
}

.soh-table-checkbox .form-check-input:hover {
    border-color: #5b6472;
}

.soh-table-checkbox .form-check-input:checked {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
}

.soh-table-checkbox .form-check-input:checked::after {
    content: "";
    position: absolute;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%) rotate(45deg);
}

.soh-table-checkbox .form-check-input:focus-visible {
    outline: 2px solid #7fb0f5;
    outline-offset: 2px;
}

.soh-table-input-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.soh-table-input {
    width: 90px;
    height: 30px;
    padding: 5px;
    border: 1px solid #c5cbd3;
    border-radius: 4px;
    font-family: inherit;
    font-size: 13px;
    color: #111827;
    background-color: #fff;
    text-align: center;
}

.soh-table-input:disabled {
    background-color: #f3f4f6;
    color: #4b5563;
    border-color: #d1d5db;
}

.soh-table-old-qty {
    min-width: 30px;
    height: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.soh-table-old-qty-label {
    font-size: 10px;
    color: #6b7280;
}

.product-stock-input-modified {
    border: 1px solid orange;
}

.product-stock-input-success {
    border: 1px solid green;
}

.product-stock-display-none {
    display: none;
}

.soh-table input::-webkit-outer-spin-button,
.soh-table input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.soh-table input[type=number] {
    -moz-appearance: textfield;
}
