.order-row-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 5px;
}
.order-row-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  margin-inline-start: auto;
}
.order-status-badge {
  padding: 2px 7px;
  border: 1px solid;
  border-radius: 5px;
  font-size: 0.875em;
  font-weight: 700;
  line-height: 1.45;
  white-space: nowrap;
}
.order-lock-badge {
  border-color: #f2a3b0;
  background: #ffe2e8;
  color: #ac1330;
}
.order-status-warning {
  border-color: #efbf82;
  background: #fff1d9;
  color: #8d4b0b;
}
.order-status-settled {
  border-color: #95d1b3;
  background: #e6f6ed;
  color: #176845;
}
.order-lock-notice {
  margin: 0;
  padding: 10px 18px;
  border-block: 1px solid #f2a3b0;
  background: #ffe2e8;
  color: #b51230;
  font-size: 1.075rem;
  font-weight: 750;
  line-height: 1.5;
}
.settlement-sheet {
  padding: clamp(12px, 2vw, 24px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.settlement-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 14px;
}
.settlement-header h2 {
  margin: 0 0 3px;
  font-size: clamp(18px, 2vw, 24px);
}
.settlement-header span { color: var(--muted); }
.settlement-header .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}
.settlement-export {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  text-decoration: none;
}
.settlement-export:hover { background: #eaf5f2; }
.settlement-section + .settlement-section { margin-top: 14px; }
.settlement-section h3 {
  margin: 0;
  padding: 6px 12px;
  border-radius: 5px 5px 0 0;
  background: #dceee9;
  color: #174f46;
  font-size: 0.95rem;
}
.settlement-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-top: 0;
}
.settlement-table-wrap:focus-visible {
  outline: 2px solid #147a6d;
  outline-offset: 1px;
}
.settlement-table-wrap table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}
.settlement-detail table { min-width: 780px; }
.settlement-sheet th,
.settlement-sheet td {
  position: static;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-top: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  vertical-align: top;
  font-size: 0.875rem;
  line-height: 1.45;
}
.settlement-sheet th { background: #f1f7f5; }
.settlement-sheet tr > :first-child { border-left: 0; }
.settlement-sheet tr > :last-child { border-right: 0; }
.settlement-sheet tbody tr:last-child > * { border-bottom: 0; }
.settlement-number { text-align: right; font-variant-numeric: tabular-nums; }
.settlement-subtotal { background: #edf6f2; font-weight: 700; }
.settlement-empty { color: var(--muted); }
@media (max-width: 640px) {
  .settlement-table-wrap:not(.settlement-detail) table { min-width: 510px; }
}
@media print {
  @page settlement { size: A4 landscape; margin: 10mm; }
  body:has(.settlement-sheet) .order-detail-main > :not(#detail-content) { display: none !important; }
  .settlement-sheet { page: settlement; border: 0; padding: 0; }
  .settlement-sheet,
  .settlement-table-wrap { overflow: visible; }
  .settlement-table-wrap table { min-width: 0 !important; }
  .settlement-sheet h3 { break-after: avoid; }
  .settlement-sheet tr { break-inside: avoid; }
  .settlement-sheet th,
  .settlement-sheet td { font-size: 8pt; padding: 3px 4px; }
  .settlement-section { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
