.settlementPage { min-width: 0; }
.settlementHeading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.settlementHeading h2 { margin: 0 0 5px; font-size: 20px; }
.settlementHeading p, .settlementFootnote, .settlementRuleHelp { color: #64748b; font-size: 12px; line-height: 1.7; margin: 0; }
.settlementActions, .settlementPagination > div { display: flex; align-items: center; gap: 8px; }
.settlementFilters { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; padding: 14px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; }
.settlementFilters label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: #64748b; min-width: 0; }
.settlementFilters input { width: 142px; min-width: 0; }
.settlementFilters .customDateControl { width: 142px; }
.settlementProduct { width: 190px; }
.settlementProduct .customSelectControl { width: 100%; }
.settlementDateDash { align-self: end; padding-bottom: 10px; color: #94a3b8; }
.settlementPresets { display: flex; gap: 5px; flex-wrap: wrap; }
.settlementPresets button, .settlementViewBar nav button { background: #fff; border-color: #dbe5f2; color: #475569; box-shadow: none; }
.settlementPresets button:hover, .settlementViewBar nav button:hover { background: #f8fafc; border-color: #bfdbfe; color: #2563eb; }
.settlementDateField { display: flex; position: relative; width: 150px; }
.settlementDateField input { width: 100%; padding-right: 34px; }
.settlementDateField > button { position: absolute; right: 2px; top: 2px; bottom: 2px; min-height: 0; padding: 0 8px; border: 0; box-shadow: none; }
.settlementCalendar { position: absolute; top: calc(100% + 6px); left: 0; width: 272px; z-index: 20; padding: 10px; border: 1px solid #dbe5f2; border-radius: 8px; background: #fff; box-shadow: 0 12px 32px rgb(15 23 42 / .14); }
.settlementCalendarHeader { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.settlementCalendarHeader button { min-height: 28px; padding: 3px 10px; }
.settlementCalendarGrid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 3px; }
.settlementCalendarGrid > span { text-align: center; padding: 6px 0; }
.settlementCalendarGrid > button { min-width: 0; min-height: 30px; padding: 3px 0; font-size: 12px; }
.settlementPage button.active, .settlementPage button[aria-selected="true"] { background: #eff6ff; border-color: #bfdbfe; color: #2563eb; }
#settlementFeedback { color: #b45309; font-size: 12px; line-height: 1.6; margin-top: 10px; overflow-wrap: anywhere; }
#settlementFeedback:empty { display: none; }
.settlementDataNote { margin: 10px 0 0; color: #64748b; font-size: 12px; line-height: 1.6; }
.settlementDataNote:empty { display: none; }
.settlementSummary { display: grid; gap: 12px; margin: 16px 0; }
.settlementCurrencySummary { border: 1px solid #e2e8f0; background: #fff; border-radius: 8px; padding: 15px 18px; }
.settlementSummaryCaption { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font-size: 12px; color: #64748b; }
.settlementSummaryCaption strong { color: #475569; font-size: 12px; }
.settlementMetrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; }
.settlementMetrics > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.settlementMetrics span { color: #64748b; font-size: 12px; }
.settlementMetrics strong { font-size: 24px; font-weight: 600; color: #0f172a; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.settlementMetrics > div:last-child strong { color: #2563eb; }
.settlementViewBar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 12px; }
.settlementViewBar nav { display: flex; gap: 5px; }
.settlementViewBar > span { font-size: 12px; color: #64748b; }
.settlementTableScroll { width: 100%; max-width: 100%; overflow: auto; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; }
.settlementTable { min-width: 800px; width: 100%; font-variant-numeric: tabular-nums; }
.settlementTable th, .settlementTable td { padding: 12px 14px; font-size: 12px; line-height: 1.6; text-align: left; border-bottom: 1px solid #edf1f6; overflow-wrap: anywhere; }
.settlementTable .num { text-align: right; }
.settlementTable .settlementStandardCell { width: 170px; }
.settlementTable .settlementStandardSelect { width: 100%; min-width: 0; }
.settlementTable .customSelectControl { width: 100%; min-width: 0; }
.settlementTable .customSelectTrigger { width: 100%; min-width: 0; }
.settlementTable thead th { color: #64748b; font-weight: 500; background: #f8fafc; }
.settlementTable tbody tr:hover { background: #fafcff; }
.settlementTable tfoot td { position: sticky; bottom: 0; z-index: 2; background: #f8fafc; font-weight: 600; box-shadow: inset 0 1px #dbe4ef; }
.settlementStatus { color: #64748b; font-size: 11px; }
.settlementPending { color: #b45309; }
.settlementPagination { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin: 12px 0; font-size: 12px; color: #64748b; }
.settlementFootnote { margin: 16px 0 0; }
.settlementEmpty { padding: 65px 20px; border: 1px solid #e2e8f0; border-radius: 8px; text-align: center; color: #64748b; background: #fff; }
.settlementMobileSort { display: none; }
.settlementModal { position: fixed; inset: 0; z-index: 20000; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgb(15 23 42 / .35); }
.settlementRuleForm { display: flex; flex-direction: column; min-width: 0; padding: 0; margin: 0; border: 1px solid #dbe5f2; border-radius: 8px; background: #fff; }
.settlementInlineRule { margin: 0 0 18px; min-width: 0; }
.settlementInlineForm { width: min(680px, 100%); box-sizing: border-box; }
.settlementInlineForm > .settlementDialogBody { overflow: visible; }
.settlementDialog { display: flex; flex-direction: column; width: 480px; max-width: 100%; max-height: calc(100dvh - 40px); min-width: 0; padding: 0; margin: 0; border: 1px solid #dbe5f2; border-radius: 8px; background: #fff; box-shadow: 0 24px 60px rgb(15 23 42 / .2); }
.settlementRuleForm > header { flex: none; padding: 18px 20px 14px; border-bottom: 1px solid #e2e8f0; }
.settlementRuleForm h2 { margin: 0 0 6px; font-size: 17px; }
.settlementRuleForm header p { color: #64748b; font-size: 12px; margin: 0; overflow-wrap: anywhere; }
.settlementDialogBody { overflow-y: auto; min-height: 0; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.settlementDialogBody > label { display: flex; flex-direction: column; gap: 7px; font-size: 12px; color: #475569; }
.settlementDialogBody > label[hidden] { display: none; }
.settlementDialogBody > label .customSelectControl { width: 100%; min-width: 0; }
.settlementDialogBody > label select { width: 100%; min-width: 0; }
.settlementDialogBody input, .settlementDialogBody textarea { width: 100%; min-width: 0; box-sizing: border-box; }
.settlementDialogBody textarea { resize: vertical; min-height: 58px; max-height: 160px; font: inherit; }
.settlementRulePicker { min-width: 0; }
.settlementRulePicker > label { display: block; margin-bottom: 7px; color: #475569; font-size: 12px; }
.settlementRulePickerControl { display: flex; gap: 6px; min-width: 0; }
.settlementRulePickerControl input { flex: 1; width: 0; }
.settlementRulePickerControl > button { flex: none; min-width: 36px; padding: 6px 10px; }
.settlementRulePicker > .settlementRuleHelp { margin-top: 6px; }
.settlementPickerStatus { margin: 6px 0; color: #64748b; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.settlementPickerStatus:empty { display: none; }
.settlementProductOptions { max-height: 156px; overflow-y: auto; border: 1px solid #dbe5f2; border-radius: 6px; background: #fff; margin-top: 6px; }
.settlementProductOptions > p { padding: 10px 12px; }
.settlementRuleForm .settlementProductOption { display: flex; flex-direction: column; gap: 3px; width: 100%; min-width: 0; padding: 9px 12px; border: 0; border-bottom: 1px solid #edf1f6; border-radius: 0; background: #fff; box-shadow: none; color: #334155; text-align: left; font-size: 12px; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
.settlementRuleForm .settlementProductOption:last-child { border-bottom: 0; }
.settlementRuleForm .settlementProductOption:hover, .settlementRuleForm .settlementProductOption:focus-visible, .settlementRuleForm .settlementProductOption.settlementOptionActive, .settlementRuleForm .settlementProductOption[aria-selected="true"] { background: #eff6ff; color: #2563eb; }
.settlementRulePickerControl input:focus-visible, .settlementRulePickerControl > button:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }
.settlementFormula { padding: 10px 12px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; color: #475569; font-size: 12px; line-height: 1.7; }
.settlementRuleForm details { font-size: 12px; }
.settlementRuleForm summary { cursor: pointer; color: #475569; padding: 5px 0; }
.settlementHistory { list-style: none; padding: 0; margin: 8px 0 0; }
.settlementHistory li { padding: 10px 0; border-top: 1px solid #e2e8f0; display: flex; flex-direction: column; gap: 5px; overflow-wrap: anywhere; }
.settlementHistory span { color: #64748b; font-size: 11px; }
.settlementHistory p { margin: 0; }
.settlementRuleForm > footer { display: flex; flex: none; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid #e2e8f0; }
.settlementSaveStatus { font-size: 12px; color: #b45309; line-height: 1.6; margin: 0; }
.settlementSaveStatus:empty { display: none; }
@media (max-width: 768px) {
  .settlementHeading { align-items: flex-start; flex-direction: column; gap: 12px; }
  .settlementFilters { gap: 10px; }
  .settlementPresets { width: 100%; }
  .settlementFilters > label { flex: 1 1 calc(50% - 10px); width: auto; }
  .settlementFilters input, .settlementFilters .customDateControl { width: 100%; }
  .settlementDateField { width: 100%; }
  .settlementFilters > label:nth-of-type(2) .settlementCalendar { left: auto; right: 0; }
  .settlementDateDash { display: none; }
  .settlementProduct { flex-basis: calc(100% - 80px) !important; }
  .settlementMetrics { display: flex; flex-direction: column; gap: 12px; }
  .settlementMetrics > div { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
  .settlementMetrics span { max-width: 55%; }
  .settlementMetrics strong { font-size: 20px; white-space: nowrap; }
  .settlementCurrencySummary { padding: 14px 12px; }
  .settlementSummaryCaption { flex-wrap: wrap; gap: 5px 12px; }
  .settlementViewBar { align-items: flex-start; flex-direction: column; }
  .settlementMobileSort { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; font-size: 12px; }
  .settlementMobileSort .customSelectControl { flex: 1; width: 0; min-width: 0; }
  .settlementTableScroll { max-height: 65dvh; }
  .settlementTable, .settlementTable > tbody, .settlementTable > tfoot { display: block; min-width: 0 !important; width: 100% !important; }
  .settlementTable > colgroup, .settlementTable > thead { display: none; }
  .settlementTable tr { display: block; border-bottom: 1px solid #cbd5e1; padding: 10px 12px; }
  .settlementTable td { display: flex; width: auto; align-items: baseline; justify-content: space-between; gap: 18px; padding: 5px 0; border: 0; text-align: right; }
  .settlementTable td.settlementStandardCell { width: auto; }
  .settlementTable td::before { content: attr(data-label); color: #64748b; text-align: left; flex-shrink: 0; }
  .settlementTable tfoot td { position: static; background: transparent; box-shadow: none; }
  .settlementTable tfoot { background: #f8fafc; }
  .settlementTable tfoot td:empty { display: none; }
  .settlementPagination { flex-direction: column; align-items: flex-start; gap: 10px; }
  .settlementModal { padding: 14px; }
  .settlementDialog { max-height: calc(100dvh - 28px); }
}
