.finance-batch-panel { margin-bottom: 6px; }
.finance-batch-panel .panel-head { align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.finance-batch-panel .panel-head p { margin: 7px 0 0; font-size: 13px; }
.finance-batch-actions, .finance-batch-selection, .finance-batch-totals { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.finance-batch-filters { padding: 0 20px 16px; }
.finance-batch-filters input { min-width: 250px; flex: 1; }
.finance-batch-totals { padding: 12px 20px; background: #f7f9fc; border-block: 1px solid #e7ecf3; font-size: 13px; }
.finance-batch-table { min-width: 1040px; }
.finance-batch-table td { vertical-align: middle; }
.finance-batch-table th:first-child, .finance-batch-table td:first-child { width: 34px; padding-inline: 12px; }
.finance-batch-table input[type="checkbox"], .finance-batch-confirm input { width: 17px; height: 17px; accent-color: #2563eb; }
.finance-batch-selection { position: sticky; top: 10px; z-index: 4; justify-content: space-between; padding: 15px 20px; border: 1px solid #e7ecf3; border-radius: 8px; background: #fff; box-shadow: 0 3px 10px #1836580d; }
.finance-batch-selection > span { min-width: 0; overflow-wrap: anywhere; }
.finance-batch-panel, #financeBatchList { min-width: 0; }
.finance-sales-panel .finance-batch-filters { display: grid; grid-template-columns: repeat(2, minmax(100px, 1fr)) minmax(160px, 2fr); gap: 10px; }
.finance-sales-panel .finance-batch-filters input, .finance-sales-panel .finance-batch-filters select { min-width: 0; width: 100%; }
.finance-sales-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px; padding-top: 14px; }
.finance-sales-card { min-width: 0; border: 1px solid #e3e8f0; border-radius: 10px; padding: 14px; overflow-wrap: anywhere; }
.finance-sales-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.finance-sales-heading > div { min-width: 0; }
.finance-sales-amount { flex: 0 0 auto; font-size: 18px; }
.finance-sales-order { display: block; max-width: 100%; padding: 9px 0; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.finance-sales-card dl { margin: 0; display: grid; gap: 8px; font-size: 13px; }
.finance-sales-card dl > div { min-width: 0; }
.finance-sales-card dt { color: var(--muted); margin-bottom: 3px; }
.finance-sales-card dd { margin: 0; }
.finance-sales-status, .finance-sales-actions { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 12px; }
.finance-sales-actions .text-button { padding-inline: 0; min-height: 36px; }
.finance-sales-empty { grid-column: 1 / -1; margin: 0; padding: 16px 0; color: var(--muted); }
.finance-batch-missing { color: #a52a2a; }
.modal:has([data-finance-approval-dialog]) { min-width: 0; max-width: 100%; }
[data-finance-approval-dialog] { min-width: 0; overflow-wrap: anywhere; }
[data-finance-approval-dialog] table { min-width: 0; width: 100%; table-layout: fixed; }
[data-finance-approval-dialog] th, [data-finance-approval-dialog] td { white-space: normal; overflow-wrap: anywhere; }
[data-finance-approval-dialog] .text-button { padding-inline: 0; white-space: normal; }
@media (max-width: 700px) {
  .finance-sales-panel .finance-batch-filters { grid-template-columns: 1fr 1fr; padding-inline: 0; }
  .finance-sales-panel #financeBatchKeyword { grid-column: 1 / -1; }
  .finance-sales-panel .finance-batch-totals { padding: 12px; }
  .finance-sales-panel .finance-batch-actions { width: 100%; }
  .finance-sales-panel .finance-batch-actions button { min-width: 0; }
  .finance-batch-selection { padding: 12px; }
}
.finance-batch-error { margin: 14px 20px; color: #9f2929; background: #fff4f2; border-color: #f4c9c2; }
.finance-batch-error ul { margin: 8px 0 0; padding-left: 22px; }
.finance-batch-confirm { display: flex; align-items: center; gap: 9px; margin-top: 18px; }
.finance-batch-shared { display: block; margin: 16px 0; }
.finance-batch-shared input { margin-top: 8px; }
.finance-batch-entry-row { padding: 14px; border: 1px solid #dfe5ee; border-radius: 10px; margin-bottom: 12px; background: #fbfcff; }
.finance-batch-entry-main { display: grid; grid-template-columns: minmax(190px, 2fr) minmax(90px, .8fr) minmax(130px, 1.1fr) minmax(125px, 1fr) auto; gap: 12px; align-items: end; }
.finance-batch-entry-row label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: #475569; }
.finance-batch-entry-row input, .finance-batch-entry-row select { width: 100%; min-width: 0; }
.finance-batch-entry-row details { margin-top: 12px; }
.finance-batch-entry-row summary { cursor: pointer; color: #2563eb; font-size: 13px; }
.finance-batch-entry-extra { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-top: 12px; }
.finance-batch-entry-extra [data-batch-allocation] { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.finance-batch-entry-extra [hidden] { display: none; }
.finance-batch-entry-extra select[multiple] { min-height: 100px; }
@media (max-width: 850px) { .finance-batch-entry-main { grid-template-columns: 1fr 1fr; } .finance-batch-entry-main label:first-child { grid-column: 1 / -1; } .finance-batch-entry-extra { grid-template-columns: 1fr; } .finance-batch-filters { padding-inline: 12px; } .finance-batch-actions button { flex: 1; } }
.finance-review-panel { margin-bottom: 20px; }
.finance-review-panel .panel-head { align-items: flex-start; flex-wrap: wrap; gap: 14px; }
.finance-review-panel .panel-head p { margin: 8px 0 0; line-height: 1.7; }
.finance-review-filters { display: grid; grid-template-columns: repeat(3, minmax(100px, 1fr)) minmax(180px, 1.4fr) auto; gap: 12px; align-items: end; padding: 0 20px 14px; }
.finance-review-filters label { display: grid; gap: 6px; min-width: 0; color: var(--muted); font-size: 13px; }
.finance-review-filters input, .finance-review-filters select { min-width: 0; width: 100%; }
.finance-review-filters .text-button { min-height: 40px; white-space: nowrap; }
.finance-review-message { padding: 0 20px; line-height: 1.7; }
.finance-review-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 10px 20px; padding: 14px; border: 1px solid var(--line, #e3e8f0); border-radius: 10px; background: #fbfcff; }
.finance-review-item > div { min-width: 0; overflow-wrap: anywhere; }
.finance-review-item strong { color: #72531e; }
.finance-review-item p { margin: 7px 0; line-height: 1.7; }
.finance-review-item small { color: var(--muted); line-height: 1.7; }
.finance-review-item > button { flex: 0 0 auto; min-height: 44px; }
.finance-review-empty { margin: 16px 20px; padding: 22px 14px; background: #f7f9fc; border: 1px dashed var(--line, #e3e8f0); border-radius: 8px; color: var(--muted); line-height: 1.7; }
.finance-review-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line, #e3e8f0); }
.finance-review-pagination span { color: var(--muted); font-size: 13px; }
.finance-review-pagination button { min-height: 44px; }
.finance-review-pagination button:disabled { opacity: .45; cursor: default; }
.finance-review-raw { border: 1px solid var(--line, #e3e8f0); border-radius: 10px; padding: 14px; margin-top: 14px; overflow-wrap: anywhere; }
.finance-review-raw dl, dl.finance-review-raw { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(0, 2fr); gap: 9px 14px; }
.finance-review-raw dt { color: var(--muted); }
.finance-review-raw dd { margin: 0; white-space: pre-wrap; min-width: 0; }
.modal-backdrop:has([data-finance-review-dialog]) { left: 0; right: auto; width: 100vw; max-width: 100vw; }
.modal:has([data-finance-review-dialog]) { min-width: 0; width: min(980px, calc(100vw - 20px)); max-width: calc(100vw - 20px); justify-self: center; }
.modal:has([data-finance-review-dialog]) .modal-head { min-width: 0; }
.modal:has([data-finance-review-dialog]) .modal-head h2 { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
.modal:has([data-finance-review-dialog]) .modal-head [data-close-modal] { flex: 0 0 38px; width: 38px; }
.modal:has([data-finance-review-dialog]) .modal-body { min-width: 0; max-width: 100%; }
[data-finance-review-dialog], [data-finance-review-dialog] .finance-review-raw { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
[data-finance-review-dialog] .finance-review-raw dt, [data-finance-review-dialog] .finance-review-raw h3 { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .finance-review-filters { grid-template-columns: 1fr 1fr; padding-inline: 12px; }
  .finance-review-item { flex-direction: column; align-items: stretch; margin-inline: 12px; }
  .finance-review-item > button { text-align: left; padding-left: 0; }
  .finance-review-message { padding-inline: 12px; }
  .finance-review-raw dl, dl.finance-review-raw { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .finance-review-raw dd { margin-bottom: 9px; }
}
