/* 公共基础样式文件。 */
:root {
    --main-color: #008b8b;
    --main-color-dark: #0a6f6f;
    --main-color-soft: #e6f4f4;
    --main-color-border: #8bc9c9;
    --main-color-ring: rgba(0, 139, 139, 0.18);
    --add-button-color: #f26b3a;
    --add-button-color-dark: #d95a2e;
    --add-button-ring: rgba(242, 107, 58, 0.18);
}

@media print {
    #debug-icon,
    #debug-bar {
        display: none !important;
    }
}

.main-bg-color { background-color: #008b8b !important; }
.main-text-color { color: #008b8b !important; }
.main-border-color { border-color: #008b8b !important; }

body {
    font-family: Arial, sans-serif;
    margin: 0;
    background: #f5f6f8;
    color: #222;
}

.wrap {
    width: 100%;
    max-width: none;
    margin: 16px auto;
    padding: 0 16px;
    box-sizing: border-box;
}

a {
    color: var(--main-color);
    text-decoration: none;
}

input,
textarea,
select,
button {
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid #bbb;
    background: #fff;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

button {
    background: var(--main-color);
    color: #fff;
    cursor: pointer;
}

button:hover,
button:focus-visible {
    background: var(--main-color-dark);
}

button.btn-add-new,
a.btn-add-new,
.btn-add-new > button {
    background: var(--add-button-color) !important;
    border-color: var(--add-button-color) !important;
    color: #fff !important;
}

button.btn-add-new:hover,
button.btn-add-new:focus-visible,
a.btn-add-new:hover,
a.btn-add-new:focus-visible,
.btn-add-new > button:hover,
.btn-add-new > button:focus-visible {
    background: var(--add-button-color-dark) !important;
    border-color: var(--add-button-color-dark) !important;
}

button.btn-add-new:focus-visible,
.btn-add-new > button:focus-visible {
    box-shadow: 0 0 0 3px var(--add-button-ring) !important;
    border-color: var(--add-button-color) !important;
}

button:focus-visible,
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--main-color);
    box-shadow: 0 0 0 3px var(--main-color-ring);
}

.app-alert-mask,
.app-save-message-mask,
.app-confirm-mask {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.24);
}

.app-alert-dialog,
.app-save-message-dialog,
.app-confirm-dialog {
    width: min(420px, 92vw);
    padding: 24px;
    border: 1px solid #cfd7d7;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.24);
    text-align: center;
}

.app-alert-title,
.app-confirm-title {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 600;
}

.app-alert-message,
.app-confirm-message {
    margin: 0 0 20px;
    color: #333;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

.app-save-message-text {
    margin: 0;
    color: #333;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

.app-alert-actions,
.app-confirm-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.app-alert-btn,
.app-confirm-btn {
    min-width: 88px;
}

.app-confirm-btn:not(.is-primary) {
    border-color: #b8c3c7;
    background: #fff;
    color: #444;
}

.goods-detail-dialog-mask {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.46);
}

.goods-detail-dialog {
    width: min(760px, 100%);
    overflow: hidden;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 20px 56px rgba(15, 23, 42, 0.26);
}

.goods-detail-dialog-header,
.goods-detail-dialog-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid #e1e8eb;
}

.goods-detail-dialog-header h2 {
    margin: 0;
    font-size: 18px;
    color: #1f2933;
}

.goods-detail-dialog-close {
    min-width: 76px;
}

.goods-detail-dialog-header .goods-detail-dialog-close {
    width: 32px;
    min-width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #52616b;
    font-size: 24px;
    line-height: 1;
}

.goods-detail-dialog-content {
    display: grid;
    grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.1fr);
    gap: 24px;
    min-height: 280px;
    padding: 22px;
}

.goods-detail-dialog-image {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 236px;
    overflow: hidden;
    background: #edf5f5;
}

.goods-detail-dialog-image img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 236px;
    object-fit: cover;
}

.goods-detail-dialog-name {
    margin: 0 0 16px;
    color: #18232d;
    font-size: 20px;
    line-height: 1.5;
}

.goods-detail-dialog-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid #e4ecee;
    border-left: 1px solid #e4ecee;
}

.goods-detail-dialog-grid > div {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    padding: 10px 12px;
    border-right: 1px solid #e4ecee;
    border-bottom: 1px solid #e4ecee;
}

.goods-detail-dialog-grid span {
    color: #77858c;
    font-size: 12px;
}

.goods-detail-dialog-grid strong {
    overflow: hidden;
    color: #24323d;
    font-size: 14px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.goods-detail-dialog-loading {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: center;
    color: #6d7a82;
}

.goods-detail-dialog-footer {
    justify-content: flex-end;
    border-top: 1px solid #e1e8eb;
    border-bottom: 0;
}

.goods-selection-dialog-mask {
    position: fixed;
    inset: 0;
    z-index: 4900;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.46);
}

.goods-selection-dialog-mask[hidden] {
    display: none;
}

.goods-selection-dialog {
    display: grid;
    grid-template-rows: auto auto minmax(220px, 1fr) auto;
    width: min(960px, 100%);
    max-height: calc(100vh - 40px);
    overflow: hidden;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 20px 56px rgba(15, 23, 42, 0.26);
}

.goods-selection-dialog-header,
.goods-selection-dialog-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
}

.goods-selection-dialog-header {
    border-bottom: 1px solid #e1e8eb;
}

.goods-selection-dialog-header h2 {
    margin: 0;
    font-size: 18px;
}

.goods-selection-dialog-close {
    width: 34px;
    min-width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #52616b;
    font-size: 24px;
    line-height: 1;
}

.goods-selection-dialog-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid #e1e8eb;
}

.goods-selection-dialog-table-wrap {
    min-height: 0;
    overflow: auto;
}

.goods-selection-dialog-table-wrap table {
    min-width: 720px;
}

.goods-selection-dialog-table-wrap th,
.goods-selection-dialog-table-wrap td {
    padding: 9px 10px;
    text-align: center;
}

.goods-selection-dialog-table-wrap th:nth-child(2),
.goods-selection-dialog-table-wrap td:nth-child(2) {
    text-align: left;
}

.goods-selection-dialog-table-wrap .goods-selection-check {
    width: 52px;
}

.goods-selection-dialog-table-wrap input[type="checkbox"] {
    width: 18px;
    height: 18px;
    padding: 0;
}

.goods-selection-detail {
    min-height: 30px;
    padding: 4px 12px;
}

.goods-selection-empty {
    height: 160px;
    color: #667085;
}

.goods-selection-dialog-footer {
    border-top: 1px solid #e1e8eb;
}

.goods-selection-dialog-footer > div {
    display: flex;
    gap: 10px;
}

.goods-selection-dialog-cancel {
    border-color: #b8c3c7;
    background: #fff;
    color: #344054;
}

.batch-discount-dialog-mask {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.46);
}

.batch-discount-dialog-mask[hidden] {
    display: none;
}

.batch-discount-dialog {
    width: min(420px, 100%);
    overflow: hidden;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 20px 56px rgba(15, 23, 42, 0.26);
}

.batch-discount-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid #e1e8eb;
}

.batch-discount-dialog-header h2 {
    margin: 0;
    font-size: 18px;
}

.batch-discount-dialog-close {
    width: 34px;
    min-width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #52616b;
    font-size: 24px;
    line-height: 1;
}

.batch-discount-dialog-content {
    display: grid;
    gap: 8px;
    padding: 20px 18px;
}

.batch-discount-dialog-content input,
.batch-discount-dialog-content select {
    width: 100%;
}

#batchDiscountDialogMessage,
#printRowsDialogMessage,
#batchLocationDialogMessage {
    min-height: 20px;
    color: #b42318;
}

.batch-discount-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 18px;
    border-top: 1px solid #e1e8eb;
}

.batch-discount-dialog-cancel {
    border-color: #b8c3c7;
    background: #fff;
    color: #344054;
}

@media (max-width: 620px) {
    .goods-detail-dialog-mask {
        padding: 12px;
    }

    .goods-detail-dialog-content {
        grid-template-columns: 1fr;
        max-height: calc(100vh - 152px);
        overflow-y: auto;
        padding: 16px;
    }

    .goods-detail-dialog-image,
    .goods-detail-dialog-image img {
        min-height: 180px;
        height: 180px;
    }

    .goods-selection-dialog-mask {
        padding: 10px;
    }

    .goods-selection-dialog {
        max-height: calc(100vh - 20px);
    }

    .goods-selection-dialog-toolbar {
        grid-template-columns: 1fr;
    }

    .goods-selection-dialog-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .goods-selection-dialog-footer > div button {
        flex: 1;
    }
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 18px;
}

table input,
table select,
table textarea,
table button {
    font-size: 16px;
}

th,
td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

th {
    background: var(--main-color-soft);
    text-align: center;
    vertical-align: middle;
}

body.numbered-selection-list table th:first-child,
body.numbered-selection-list table td:first-child {
    width: 40px;
    padding-left: 0;
    padding-right: 0;
    text-align: center;
}

body.numbered-selection-list table th:first-child input[type="checkbox"],
body.numbered-selection-list table td:first-child input[type="checkbox"] {
    display: block;
    width: 18px;
    min-width: 18px;
    height: 18px;
    margin: 0 auto;
}

body.numbered-selection-list table th:nth-child(2),
body.numbered-selection-list table td:nth-child(2) {
    text-align: center;
}

table #toggleAll[type="checkbox"],
table #checkAll[type="checkbox"],
table #toggleAllSourceCandidates[type="checkbox"],
table #toggleAllGoodsSelection[type="checkbox"],
table .row-check[type="checkbox"],
table .rowCheck[type="checkbox"],
table .quotation-select[type="checkbox"],
table .goods-selection-row-check[type="checkbox"],
table .group-check[type="checkbox"],
table .right-check[type="checkbox"],
table input[type="checkbox"][data-source-candidate] {
    box-sizing: border-box !important;
    display: block !important;
    width: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    height: 18px !important;
    padding: 0 !important;
    margin: 0 auto !important;
    border: initial;
    background: initial;
    box-shadow: none;
    vertical-align: middle;
    appearance: auto;
    -webkit-appearance: checkbox;
}

table #toggleAll[type="checkbox"]:focus,
table #checkAll[type="checkbox"]:focus,
table #toggleAllSourceCandidates[type="checkbox"]:focus,
table #toggleAllGoodsSelection[type="checkbox"]:focus,
table .row-check[type="checkbox"]:focus,
table .rowCheck[type="checkbox"]:focus,
table .quotation-select[type="checkbox"]:focus,
table .goods-selection-row-check[type="checkbox"]:focus,
table .group-check[type="checkbox"]:focus,
table .right-check[type="checkbox"]:focus,
table input[type="checkbox"][data-source-candidate]:focus {
    border: initial;
    box-shadow: none;
}

td {
    vertical-align: middle;
}

body[data-trade-bill="1"] table {
    font-size: 19px;
}

body[data-trade-bill="1"] table input,
body[data-trade-bill="1"] table select,
body[data-trade-bill="1"] table textarea {
    font-size: 16px;
}

body[data-trade-bill="1"] table .row-action-btn,
body[data-trade-bill="1"] table .bill-status,
body[data-trade-bill="1"] table .entry-batch-btn {
    font-size: 15px !important;
}

body[data-trade-bill="1"].bill-list-page table {
    font-size: 17px;
}

body[data-trade-bill="1"].bill-list-page table input,
body[data-trade-bill="1"].bill-list-page table select,
body[data-trade-bill="1"].bill-list-page table textarea,
body[data-trade-bill="1"].bill-list-page table button {
    font-size: 14px;
}

body[data-trade-bill="1"].bill-list-page table .row-action-btn,
body[data-trade-bill="1"].bill-list-page table .bill-status,
body[data-trade-bill="1"].bill-list-page table .entry-batch-btn {
    font-size: 13px !important;
}

.panel {
    background: #fff;
    border: 1px solid #d7e6e6;
}

.bill-sheet {
    position: relative;
    background: #fff;
    border: 1px solid #cfcfcf;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
    padding: 12px 20px 20px;
}

.bill-sheet::after {
    content: '';
    position: absolute;
    right: 40px;
    bottom: var(--audit-mark-bottom, 65px);
    width: 150px;
    height: 74px;
    background: url('../images/audit.png') 0 0 no-repeat;
    background-size: contain;
    display: none;
    pointer-events: none;
    z-index: 40;
}

.bill-sheet.is-audited::after {
    display: block;
}

.bill-form-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 10px;
}

body[data-trade-bill="1"] .bill-form-fixed {
    position: sticky;
    top: 0;
    z-index: 30;
    margin-top: -12px;
    padding-top: 12px;
    background: #fff;
    box-shadow: 0 1px 0 #e7eeee;
}

body[data-trade-bill="1"] .bill-form-fixed > .bill-form-section {
    padding-top: 0;
    border-top: 0;
}

.bill-form-title {
    margin: 0;
    font-size: 24px;
    line-height: 1.3;
    font-weight: 600;
}

.bill-form-tools {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 34px;
    gap: 8px;
    flex-wrap: nowrap;
}

.bill-form-tools .button-link,
.bill-form-tools button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 78px;
    height: 34px;
    min-height: 34px;
    padding: 7px 14px;
    border: 1px solid var(--main-color);
    background: var(--main-color);
    color: #fff;
    text-decoration: none;
}

.bill-form-tools .button-link[disabled],
.bill-form-tools button[disabled] {
    cursor: not-allowed;
    opacity: 0.55;
}

.bill-form-section {
    padding: 14px 0;
    border-top: 1px solid #e7eeee;
}

.bill-form-section:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.bill-form-section h2 {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.bill-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px 16px;
}

.bill-form-grid.bill-head-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.bill-form-grid.bill-head-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.bill-form-grid.bill-head-4 .field,
.bill-form-grid.bill-head-5 .field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bill-form-grid.bill-head-4 .field > label,
.bill-form-grid.bill-head-5 .field > label {
    flex: 0 0 auto;
    margin-bottom: 0;
    white-space: nowrap;
}

.bill-form-grid.bill-head-4 .field > input,
.bill-form-grid.bill-head-4 .field > select,
.bill-form-grid.bill-head-4 .field > .bill-combo,
.bill-form-grid.bill-head-4 .field > .bill-no-text,
.bill-form-grid.bill-head-5 .field > input,
.bill-form-grid.bill-head-5 .field > select,
.bill-form-grid.bill-head-5 .field > .bill-combo,
.bill-form-grid.bill-head-5 .field > .bill-no-text {
    flex: 0 0 150px;
    width: 150px;
    max-width: 150px;
    min-width: 0;
}

.bill-form-grid .field.bill-contact-field > .bill-combo {
    flex: 0 0 225px;
    width: 225px;
    max-width: 225px;
}

.bill-contact-lookup.bill-combo::after {
    display: none;
}

.bill-contact-lookup.bill-combo input {
    padding-right: 10px;
}

.bill-form-grid.cols-5,
.bill-form-search.cols-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.bill-form-grid .field,
.bill-form-search .field,
.bill-form-summary .field {
    min-width: 0;
}

.bill-form-grid .field.full,
.bill-form-search .field.full,
.bill-form-summary .field.full {
    grid-column: 1 / -1;
}

.bill-form-grid .field.span-2,
.bill-form-search .field.span-2,
.bill-form-summary .field.span-2 {
    grid-column: span 2;
}

.bill-form-grid .field.span-3,
.bill-form-search .field.span-3,
.bill-form-summary .field.span-3 {
    grid-column: span 3;
}

.bill-form-grid label,
.bill-form-search label,
.bill-form-summary label {
    display: block;
    margin-bottom: 6px;
    color: #444;
}

.bill-form-grid input,
.bill-form-grid select,
.bill-form-grid textarea,
.bill-form-search input,
.bill-form-search select,
.bill-form-search textarea,
.bill-form-summary input,
.bill-form-summary select,
.bill-form-summary textarea {
    width: 100%;
}

.bill-form-grid.bill-head-4 input,
.bill-form-grid.bill-head-4 select,
.bill-form-grid.bill-head-5 input,
.bill-form-grid.bill-head-5 select {
    max-width: 100%;
    height: 34px;
    padding: 6px 10px;
}

.bill-no-text {
    display: flex;
    align-items: center;
    min-height: 34px;
    padding: 0 4px;
    color: #222;
    white-space: nowrap;
}

.bill-form-summary input,
.bill-form-summary select,
.bill-form-search input,
.bill-form-search select {
    min-height: 34px;
    padding: 6px 10px;
}

.bill-combo {
    position: relative;
}

.lookup-select {
    position: relative;
    display: block;
    min-width: 0;
}

.bill-combo input {
    padding-right: 34px;
}

.bill-combo.lookup-select input {
    display: block;
    width: 100%;
    min-width: 0;
}

.lookup-select input,
.lookup-select select {
    width: 100%;
}

.bill-combo::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    pointer-events: none;
    background: no-repeat center/16px 16px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2360707c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3Cpath d='M11 8v6'/%3E%3Cpath d='M8 11h6'/%3E%3C/svg%3E");
}

.bill-form-search,
.bill-form-summary {
    display: grid;
    gap: 12px 16px;
}

.bill-form-search {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.bill-form-summary {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.bill-form-summary .field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bill-form-summary .field > label {
    flex: 0 0 108px;
    width: 108px;
    margin-bottom: 0;
    white-space: nowrap;
}

.bill-form-summary .field > input,
.bill-form-summary .field > select,
.bill-form-summary .field > .bill-combo,
.bill-form-summary .field > .bill-no-text {
    flex: 0 1 120px;
    width: 120px;
    max-width: 120px;
    min-width: 0;
}

.bill-form-search .field.action,
.bill-form-summary .field.action {
    align-self: end;
}

.bill-form-search .field.action button,
.bill-form-summary .field.action button {
    width: 100%;
}

.bill-form-summary .field.action {
    align-self: end;
}

.bill-form-summary .field.action button {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
}

.bill-form-summary .field.action > label {
    visibility: hidden;
}

.bill-form-note textarea {
    width: 100%;
    min-height: 92px;
    resize: vertical;
}

.account-entry-table + .bill-form-note {
    margin-top: 14px;
}

.bill-form-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 20px;
    margin-top: 12px;
    color: #999;
}

.bill-form-meta .item {
    min-width: 0;
}

.bill-form-meta label {
    display: inline-block;
    min-width: 88px;
}

.bill-hidden-fields {
    display: none;
}

.bill-form-subsection {
    margin-top: 12px;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.image-card {
    border: 1px solid var(--main-color-border);
    background: var(--main-color-soft);
    padding: 10px;
}

.image-card img {
    display: block;
    width: 100%;
    height: 120px;
    object-fit: cover;
    background: #fff;
    border: 1px solid #d7e6e6;
}

.image-meta {
    margin-top: 8px;
    font-size: 12px;
    color: #666;
    word-break: break-all;
}

.image-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.image-empty {
    color: #666;
}

.image-upload-message {
    min-height: 20px;
    color: #667085;
}

.image-upload-message.is-loading {
    color: #475467;
}

.image-upload-message.is-success {
    color: #027a48;
}

.image-upload-message.is-error {
    color: #b42318;
}

.entry-row-no {
    width: 48px;
    min-width: 48px;
    text-align: center;
    font-weight: 600;
    color: #4a5568;
    background: #f7f7f7;
}

.entry-row-drag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 38px;
    cursor: move;
    user-select: none;
}

.entry-row-ops {
    width: 72px;
    min-width: 72px;
    padding: 4px 6px;
    text-align: center;
    vertical-align: middle;
    background: #f7f7f7;
}

.entry-row-actions {
    display: flex;
    justify-content: center;
    gap: 4px;
}

.entry-row-actions button {
    min-width: 24px;
    height: 28px;
    padding: 0 6px;
    line-height: 1;
}

body[data-trade-bill="1"] #entriesBody .entry-row-actions button {
    flex: 0 0 28px;
    width: 28px;
    min-width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 6px;
}

body[data-trade-bill="1"] #entriesBody .entry-row-actions .add-entry,
body[data-trade-bill="1"] #entriesBody .entry-row-actions .remove-entry {
    font-size: 17px;
}

body[data-trade-bill="1"] #entriesBody .entry-row-actions .remove-entry {
    font-size: 18px;
}

body[data-trade-bill="1"] #entriesBody .entry-row-actions {
    gap: 8px;
}

body[data-trade-bill="1"] #entriesBody .entry-row-actions .add-entry {
    border-color: var(--main-color);
    background: var(--main-color);
}

body[data-trade-bill="1"] #entriesBody .entry-row-actions .add-entry:hover,
body[data-trade-bill="1"] #entriesBody .entry-row-actions .add-entry:focus-visible {
    border-color: var(--main-color-dark);
    background: var(--main-color-dark);
}

body[data-trade-bill="1"] #entriesBody .entry-row-actions .remove-entry {
    border-color: #bf6262;
    background: #bf6262;
}

body[data-trade-bill="1"] #entriesBody .entry-row-actions .remove-entry:hover,
body[data-trade-bill="1"] #entriesBody .entry-row-actions .remove-entry:focus-visible {
    border-color: #a94e4e;
    background: #a94e4e;
}

body[data-trade-bill="1"] #entriesBody .entry-row-actions .goods-detail-entry {
    border-color: #3b8194;
    background-color: #3b8194;
}

body[data-trade-bill="1"] #entriesBody .entry-row-actions .goods-detail-entry:hover,
body[data-trade-bill="1"] #entriesBody .entry-row-actions .goods-detail-entry:focus-visible {
    border-color: #2f6d7e;
    background-color: #2f6d7e;
}

body[data-trade-bill="1"] #entriesBody .entry-row-actions .goods-edit-entry {
    border-color: #ae8739;
    background-color: #ae8739;
}

body[data-trade-bill="1"] #entriesBody .entry-row-actions .goods-edit-entry:hover,
body[data-trade-bill="1"] #entriesBody .entry-row-actions .goods-edit-entry:focus-visible {
    border-color: #93712c;
    background-color: #93712c;
}

.entry-goods-combo .entry-goods-keyword {
    padding-right: 38px;
}

.entry-goods-combo::after {
    display: none;
}

body[data-trade-bill="1"] .entry-goods-list .choose-goods strong {
    font-size: 17px;
}

.entry-goods-lookup {
    position: absolute;
    top: 5px;
    right: 4px;
    z-index: 2;
    width: 28px;
    min-width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 17px 17px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='5' cy='12' r='1.8' fill='%2360707c'/%3E%3Ccircle cx='12' cy='12' r='1.8' fill='%2360707c'/%3E%3Ccircle cx='19' cy='12' r='1.8' fill='%2360707c'/%3E%3C/svg%3E");
}

.entry-goods-lookup:hover,
.entry-goods-lookup:focus-visible {
    background-color: var(--main-color-soft);
}

.entry-row-actions .goods-detail-entry {
    min-width: 28px;
    padding: 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 14px 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E");
}

.entry-row-actions .goods-edit-entry {
    min-width: 28px;
    padding: 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 14px 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z'/%3E%3C/svg%3E");
}

.entry-batch-btn {
    margin-left: 6px;
    min-width: 40px;
    height: 24px;
    padding: 0 6px;
    font-size: 12px;
    line-height: 1;
}

.entry-goods-cell {
    min-width: 260px;
}

.trade-entry-table {
    min-width: 1320px;
    table-layout: fixed;
}

.trade-entry-table .trade-col-row-no { width: 48px; }
.trade-entry-table .trade-col-actions { width: 140px; }
.trade-entry-table .trade-col-goods { width: 334px; }
.trade-entry-table .trade-col-spec { width: 84px; }
.trade-entry-table .trade-col-location { width: 112px; }
.trade-entry-table .trade-col-pieces { width: 78px; }
.trade-entry-table .trade-col-qty { width: 78px; }
.trade-entry-table .trade-col-price { width: 100px; }
.trade-entry-table .trade-col-amount { width: 100px; }
.trade-entry-table .trade-col-discount-rate { width: 72px; }
.trade-entry-table .trade-col-deduction { width: 60px; }
.trade-entry-table .trade-col-receipt-signer { width: 88px; }
.trade-entry-table .entry-receipt-signer { text-align: center; }
.trade-entry-table .trade-col-description { width: 188px; }

.trade-entry-table .entry-spec {
    min-width: 0;
    text-align: center;
}

.trade-entry-table .entry-spec,
.trade-entry-table .entry-amount {
    font-size: 16px;
}

#accountsBody td {
    height: 40px;
    padding: 0;
}

.account-entry-table {
    table-layout: fixed;
}

.bill-form-summary + .account-entry-table {
    margin-top: 16px;
}

.account-entry-table th:nth-child(1) { width: 86px; }
.account-entry-table th:nth-child(2) { width: 30%; }
.account-entry-table th:nth-child(3) { width: 18%; }
.account-entry-table th:nth-child(4) { width: 20%; }

.account-entry-table tfoot td {
    height: 40px;
    padding: 0 8px;
    font-weight: 700;
}

.account-entry-table tfoot td:first-child {
    text-align: right;
}

#accountsBody input,
#accountsBody select {
    display: block;
    width: 100%;
    min-width: 0;
    height: 40px;
    margin: 0;
    padding: 0 8px;
    border-color: transparent;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

#accountsBody input:focus,
#accountsBody select:focus {
    border-color: var(--main-color-border);
    background: #fff;
    box-shadow: inset 0 0 0 1px var(--main-color-border);
}

.account-row-actions {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.account-row-actions button {
    min-width: 28px;
    height: 28px;
    padding: 0;
    font-size: 18px;
    line-height: 1;
}

.entry-goods-cell .bill-combo {
    width: 100%;
}

.entry-spec {
    min-width: 120px;
}

#entriesBody input,
#entriesBody select {
    width: 100%;
    min-width: 0;
    display: block;
    box-sizing: border-box;
    margin: 0;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    padding: 0 6px;
    height: 38px;
    border-radius: 0;
}

#entriesBody td {
    padding: 0;
    height: 38px;
}

#entriesBody td.entry-row-no,
#entriesBody td.entry-row-ops,
#entriesBody td.entry-spec,
#entriesBody td.entry-amount {
    padding: 0 8px;
}

#entriesBody tr:nth-child(odd) td {
    background: #fffde8;
}

#entriesBody tr:nth-child(even) td {
    background: #f7fbff;
}

#entriesBody td:focus-within {
    background: #fff;
}

#entriesBody tr.entry-drag-over td {
    box-shadow: inset 0 2px 0 var(--main-color);
}

#entriesBody input:focus,
#entriesBody select:focus {
    background: #fff;
    border-color: var(--main-color-border);
    box-shadow: inset 0 0 0 1px var(--main-color-border);
}

#entriesBody .bill-combo::after {
    opacity: 0;
}

#entriesBody .bill-combo:focus-within::after {
    opacity: 1;
}

#entriesBody tr td .entry-goods-list.compact {
    left: 0;
    right: 0;
}

table tfoot td {
    background: #fafcfc;
    font-weight: 600;
}

.entry-total-label {
    text-align: left;
    color: #334155;
}

.toolbar,
.bar,
.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.muted {
    color: #666;
}

.danger {
    color: #b42318;
}

.right,
.number {
    text-align: right;
}

.list,
.candidate-list {
    display: grid;
    gap: 8px;
}

.candidate {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--main-color-border);
    padding: 10px 12px;
    background: var(--main-color-soft);
}

.candidate-list.compact {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 30;
    max-height: 260px;
    overflow: auto;
    gap: 0;
    background: #fff;
    border: 1px solid var(--main-color-border);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.candidate-list.compact.has-items {
    display: block;
}

.lookup-select-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 30;
    max-height: 260px;
    overflow: auto;
    gap: 0;
    background: #fff;
    border: 1px solid var(--main-color-border);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.lookup-select-dropdown.has-items {
    display: block;
}

.lookup-select-item {
    display: block;
    border: 0;
    border-bottom: 1px solid #edf3f3;
    padding: 8px 10px;
    background: #fff;
    cursor: pointer;
}

.lookup-select-item:last-child {
    border-bottom: 0;
}

.lookup-select-item strong {
    margin-bottom: 2px;
}

.lookup-select-item:hover {
    background: #f0fbfb;
}

.lookup-select-add {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 0;
    border-top: 1px solid #dfe8ea;
    border-radius: 0;
    background: #fff;
    color: #46545c;
    text-align: left;
}

.lookup-select-add::before {
    content: '+';
    color: #88959c;
    font-size: 24px;
    font-weight: 400;
    line-height: 18px;
}

.lookup-select-add:hover {
    background: #f0fbfb;
}

.quick-contact-dialog-mask {
    position: fixed;
    inset: 0;
    z-index: 5200;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.42);
}

.quick-contact-dialog-mask[hidden] {
    display: none;
}

.quick-contact-dialog {
    display: flex;
    flex-direction: column;
    width: min(640px, 100%);
    height: min(520px, calc(100vh - 36px));
    overflow: hidden;
    border: 1px solid #cfd8dc;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 20px 56px rgba(15, 23, 42, 0.25);
}

.quick-contact-dialog header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #e1e8eb;
}

.quick-contact-dialog h2 {
    margin: 0;
    font-size: 18px;
}

.quick-contact-dialog-close {
    width: 32px;
    min-width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #52616b;
    font-size: 18px;
}

.quick-contact-dialog iframe {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    border: 0;
}

.candidate-list.compact .candidate {
    display: block;
    border: 0;
    border-bottom: 1px solid #edf3f3;
    padding: 8px 10px;
    background: #fff;
    cursor: pointer;
}

.candidate-list.compact .candidate:last-child {
    border-bottom: 0;
}

.candidate-list.compact .candidate strong {
    margin-bottom: 2px;
}

.candidate-list.compact .candidate:hover {
    background: #f0fbfb;
}

.candidate strong {
    display: block;
    margin-bottom: 4px;
}

.candidate:hover,
.candidate-item:hover,
.link:hover,
.tile:hover,
.module-link:hover {
    border-color: var(--main-color);
    background: #f0fbfb;
}

.button-link,
a.button-link {
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.button-link:hover,
a.button-link:hover {
    background: var(--main-color-dark) !important;
    border-color: var(--main-color-dark) !important;
}

.bill-status {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    min-height: 28px;
    padding: 0 10px;
    margin: 0 auto;
    border-radius: 999px;
    text-align: center;
    line-height: 1;
}

td .bill-status,
th .bill-status {
    margin-left: auto;
    margin-right: auto;
}

table tbody tr:hover {
    background: #f7fcfc;
}

input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--main-color);
    outline-offset: 2px;
}

.js-date-field {
    background: #fff;
    min-width: 140px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2360707c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px 16px;
    padding-right: 34px;
    cursor: pointer;
}

.js-date-field + .ui-datepicker-trigger {
    display: none !important;
}

.ui-datepicker {
    z-index: 2000 !important;
}

@media (max-width: 1200px) {
    .bill-form-grid.cols-5,
    .bill-form-search.cols-5 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .bill-form-grid,
    .bill-form-search,
    .bill-form-summary,
    .bill-form-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .wrap {
        padding: 0 16px;
    }

    .bill-sheet {
        padding: 12px;
    }

    .bill-form-header {
        flex-direction: column;
    }

    .bill-form-tools {
        width: 100%;
        height: auto;
        flex-wrap: wrap;
    }

    .bill-form-grid,
    .bill-form-grid.cols-5,
    .bill-form-search,
    .bill-form-search.cols-5,
    .bill-form-summary,
    .bill-form-meta {
        grid-template-columns: 1fr;
    }

    .bill-form-grid.bill-head-4 .field,
    .bill-form-grid.bill-head-5 .field,
    .bill-form-summary .field {
        display: block;
    }

    .bill-form-grid.bill-head-4 .field > label,
    .bill-form-grid.bill-head-5 .field > label,
    .bill-form-summary .field > label {
        margin-bottom: 6px;
    }

    .bill-form-grid .field.bill-contact-field > .bill-combo {
        width: 100%;
        max-width: none;
    }
}

#ui-datepicker-div {
    z-index: 2200 !important;
    border: 1px solid #cfd8dc;
    background: #fff;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18);
    padding: 6px 6px 4px;
    border-radius: 8px;
}

#ui-datepicker-div .ui-datepicker-header {
    background: #f4fbfb;
    border: 0;
    border-radius: 6px;
    padding: 4px 0 6px;
}

#ui-datepicker-div .ui-datepicker-title {
    color: #16323a;
    font-weight: 600;
}

#ui-datepicker-div .ui-datepicker-prev,
#ui-datepicker-div .ui-datepicker-next {
    top: 4px;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#ui-datepicker-div .ui-datepicker-prev-hover,
#ui-datepicker-div .ui-datepicker-next-hover {
    background: #dff3f3;
    border: 0;
}

#ui-datepicker-div .ui-datepicker-prev span,
#ui-datepicker-div .ui-datepicker-next span {
    display: none;
}

#ui-datepicker-div .ui-datepicker-prev::before,
#ui-datepicker-div .ui-datepicker-next::before {
    content: "";
    display: block;
    width: 14px;
    height: 14px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 14px 14px;
}

#ui-datepicker-div .ui-datepicker-prev::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M9.5 3.5 5 8l4.5 4.5' stroke='%230f5963' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

#ui-datepicker-div .ui-datepicker-next::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M6.5 3.5 11 8l-4.5 4.5' stroke='%230f5963' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

#ui-datepicker-div .ui-datepicker-calendar th {
    color: #6b7b86;
    font-weight: 600;
}

#ui-datepicker-div .ui-state-default {
    background: #f6f8f9;
    border: 1px solid #e1e8eb;
    color: #33414b;
    text-align: center;
    border-radius: 4px;
}

#ui-datepicker-div .ui-state-hover {
    background: #e8f6f6;
    border-color: #bfe3e3;
    color: #1c4f58;
}

#ui-datepicker-div .ui-state-highlight {
    border-color: #8ccaca;
    background: #eef9f9;
    color: #0f5963;
}

#ui-datepicker-div .ui-state-active {
    background: var(--main-color);
    border-color: var(--main-color);
    color: #fff;
}
