.wor-summary { margin: 5px 0 17px; }
.wor-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.wor-card {
  min-width: 0;
  padding: 12px 16px 14px;
  background: #fff;
  border: 1px solid #dbe4ef;
  border-radius: 9px;
}
.wor-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.wor-label { margin: 0; color: #243652; font-size: 15px; line-height: 1.4; font-weight: 600; }
.wor-amount {
  display: block;
  margin-top: 4px;
  color: #10254a;
  font-size: clamp(24px, 1.65vw, 32px);
  line-height: 1.35;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.wor-period {
  min-height: 31px;
  max-width: 100%;
  border: 1px solid #d6dfeb;
  border-radius: 6px;
  padding: 4px 10px;
  background: #fff;
  color: #263852;
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
}
select.wor-period { min-width: 94px; }
.wor-period:hover { border-color: #a6b5cb; }
.wor-month-picker { position: relative; max-width: 100%; }
.wor-month-trigger { min-width: 124px; display: inline-flex; align-items: center; justify-content: space-between; gap: 12px; }
.wor-month-trigger::after {
  content: ''; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg);
}
.wor-month-trigger[aria-expanded="true"] { border-color: #9bb9f5; }
.wor-month-panel {
  position: absolute;
  z-index: 7;
  top: calc(100% + 5px);
  inset-inline-end: 0;
  width: 226px;
  max-width: calc(100vw - 30px);
  padding: 7px 8px 9px;
  border: 1px solid #dce4ed;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 14px #192d481c;
}
.wor-month-heading { display: flex; justify-content: space-between; align-items: center; padding-bottom: 6px; border-bottom: 1px solid #ebeff4; color: #20344e; font-size: 14px; }
.wor-year-step, .wor-month-choice { border: 0; border-radius: 5px; background: #fff; color: #263853; }
.wor-year-step { min-width: 28px; height: 28px; padding: 0; font-size: 20px; line-height: 1; }
.wor-month-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px 4px; margin-top: 5px; }
.wor-month-choice { min-height: 27px; padding: 2px; font-size: 13px; }
.wor-month-choice:hover, .wor-year-step:hover { background: #edf3fd; }
.wor-month-choice[aria-pressed="true"] { background: #2469ef; color: #fff; }
.wor-month-choice:disabled, .wor-year-step:disabled { cursor: default; background: #f5f7fa; color: #8a98ac; }
.wor-error { display: flex; align-items: center; gap: 10px; margin: 7px 0 0; color: #6a5060; font-size: 13px; }
#order-filters .wb-search { border-color: #d9dfe7; }
#order-search:focus { border: 0; outline: 0; box-shadow: none; }
#order-filters .wb-search:focus-within { border-color: #65758b; }

@media (min-width: 761px) and (max-width: 1100px) {
  .wor-card { padding-inline: 12px; }
  .wor-header { align-items: flex-start; flex-direction: column; }
  .wor-month-panel { inset-inline-start: 0; inset-inline-end: auto; }
}
.wf-orders-heading, .wf-list-title, .wf-pager, .wf-pages,
.wf-member-tabs, .wf-ledger-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.wf-orders-heading { justify-content: space-between; padding: 14px 17px 0; }
.wf-orders-heading h2 { margin: 0; font-size: 18px; }
.wf-list-title #order-count { margin: 0; color: #637790; font-size: 12px; }
.wf-orders-heading #orders-export { min-height: 33px; padding: 6px 12px; }
.wf-pager { justify-content: space-between; border-top: 1px solid var(--line); padding: 10px 15px; color: #60738b; font-size: 12px; }
.wf-pages { gap: 4px; }
.wf-pages button, .wf-member-tabs button {
  background: #fff; border: 1px solid #dae3ee; border-radius: 5px; color: #415977; font: inherit; cursor: pointer;
}
.wf-pages button { min-width: 29px; min-height: 29px; padding: 2px 5px; }
.wf-pages [aria-current="page"], .wf-member-tabs [aria-pressed="true"] {
  background: #edf3ff; color: #155bdc; border-color: #bbd2fa; font-weight: 600;
}
.wf-pages button:disabled { opacity: .45; cursor: default; }
#all-orders, #member-table, #ledger-table { overflow: visible; }
#view-orders .wf-orders { table-layout: fixed; white-space: normal; }
#view-orders .wf-orders :is(th, td), #view-members table td {
  height: auto; padding: 7px 11px; line-height: 1.4; overflow-wrap: anywhere;
}
#view-orders .wf-orders td { height: 48px; }
.wf-orders th:nth-child(1), .wf-orders th:nth-child(2) { width: 19%; }
.wf-orders th:nth-child(3), .wf-orders th:nth-child(5) { width: 13%; }
.wf-orders th:nth-child(4) { width: 12%; }
.wf-orders th:nth-child(6) { width: 15%; }
.wf-orders th:nth-child(4), .wf-order-amount, .wf-orders th:last-child, .wf-order-action { text-align: right; }
.wf-order-number, .wf-order-time, .wf-order-amount, .wf-ledger-time, .wf-pager { font-variant-numeric: tabular-nums; }
.wf-order-number { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#view-members td.member-decrease, .member-ledger-detail td.member-decrease { color: #a24d35; }
.wf-member-lists { position: relative; }
.wf-member-lists > section.wb-panel { border: 0; border-radius: 0; margin: 0; }
.wf-member-tabs { padding: 14px 18px 10px; }
.wf-member-lists h2 { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
.wf-member-lists .wb-panel-heading { padding-top: 0; }
.wf-member-lists .member-ledger-heading > span { position: absolute; top: 23px; right: 18px; }
.wf-member-lists .wb-panel-heading:has(.member-ledger-heading) { padding: 0; }
.wf-member-tabs button { min-height: 35px; padding: 6px 12px; font-size: 13px; }
.wf-ledger-filters { padding: 0 18px 13px; }
.wf-ledger-filters :is(input, select) { width: auto; max-width: 100%; min-height: 34px; padding: 7px 9px; font-size: 12px; }
.wf-ledger-filters input { width: min(230px, 100%); }
#view-members :is(.member-accounts, .member-ledger) td { height: 45px; white-space: normal; }
.member-ledger-detail { width: 100%; white-space: normal; table-layout: fixed; }
.member-ledger-detail :is(th, td) { padding: 8px; overflow-wrap: anywhere; }
.member-ledger-detail th:nth-child(1) { width: 23%; }
.member-ledger-detail th:nth-child(2) { width: 37%; }

@media (max-width: 760px) {
  .wor-cards { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 5px; }
  .wor-summary { margin-bottom: 10px; }
  .wor-card { position: relative; padding: 8px 6px; }
  .wor-card:has(.wor-month-trigger[aria-expanded="true"]) { z-index: 2; }
  .wor-header { display: block; }
  .wor-label { font-size: 11px; }
  .wor-header .wor-period { display: block; width: 100%; min-width: 0; min-height: 26px; margin-top: 3px; padding: 1px 3px; font-size: 11px; }
  .wor-header .wor-month-trigger { display: flex; gap: 2px; }
  .wor-month-panel { left: 50%; right: auto; transform: translateX(-50%); }
  .wor-amount { margin: 5px 0 0; font-size: clamp(15px, 4vw, 22px); line-height: 1.15; }
  .wf-orders-heading { padding: 9px 10px 0; }
  .wf-orders-heading h2 { font-size: 15px; }
  .wf-orders-heading #orders-export { min-height: 28px; padding: 3px 6px; font-size: 11px; }
  #view-orders #order-filters {
    display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,.8fr) minmax(0,1.15fr) auto; gap: 4px; padding: 8px 9px;
  }
  #order-filters > * { min-width: 0; max-width: 100%; }
  #view-orders #order-filters .wb-search { width: auto; min-height: 30px; padding-left: 6px; }
  #order-filters .wb-search [data-icon] { display: none; }
  #view-orders #order-filters :is(select, input) { min-width: 0; width: 100%; min-height: 30px; padding: 3px; font-size: 11px; }
  #view-orders #order-reset { min-height: 30px; padding: 3px 5px; font-size: 11px; }
  :is(.wf-orders, .member-ledger, .member-ledger-detail) thead {
    position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden;
  }
  #view-orders .wf-orders, #view-members .member-ledger, .member-ledger-detail { display: block; min-width: 0; }
  #view-orders .wf-orders tbody, :is(.member-ledger, .member-ledger-detail) tbody { display: grid; gap: 6px; padding: 0 8px 6px; }
  #view-orders .wf-orders tr {
    min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) auto;
    grid-template-areas: "room state" "member state" "time time" "amount action" "payment action";
    align-items: start; column-gap: 6px; padding: 7px 10px;
    border: 1px solid var(--line); border-radius: 7px;
  }
  #view-orders .wf-orders td { display: block; width: auto; height: auto; min-height: 0; padding: 0; border: 0; font-size: 12px; line-height: 1.35; }
  .wf-order-room { grid-area: room; }
  .wf-order-room strong { font-size: 14px; }
  .wf-order-room .wf-order-number { display: inline-block; vertical-align: middle; max-width: 55%; margin: 0 0 0 5px; font-size: 10px; }
  .wf-order-member { grid-area: member; }
  .wf-order-time { grid-area: time; margin: 2px 0; }
  .wf-order-time small { display: inline; margin-left: 5px; }
  .wf-order-amount { grid-area: amount; text-align: left; }
  .wf-order-payment { grid-area: payment; }
  .wf-order-state { grid-area: state; max-width: 100px; text-align: right; }
  .wf-order-state small { white-space: normal; font-size: 10px; }
  .wf-order-action { grid-area: action; align-self: center; }
  .wf-order-action button { min-height: 30px; }
  #view-orders .wf-order-payment { color: #647a95; font-size: 11px; }
  .wf-order-amount .wb-money { font-size: 14px; }
  .wf-pager { padding: 7px; gap: 4px; }
  .wf-pages { gap: 3px; }
  .wf-pages button { min-width: 25px; min-height: 29px; font-size: 12px; }
  .wf-page-summary { font-size: 11px; }
  .wf-member-tabs { padding: 10px; }
  .wf-member-lists .member-ledger-heading > span { top: 19px; right: 10px; }
  .wf-ledger-filters { padding: 0 10px 9px; gap: 5px; }
  .wf-ledger-filters input { flex: 1; min-width: 0; }
  .wf-ledger-filters select { min-width: 0; max-width: 48%; }
  :is(.member-ledger, .member-ledger-detail) tr {
    display: grid; grid-template-columns: minmax(0,1fr) auto; column-gap: 6px;
    border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px;
  }
  #view-members .member-ledger td, .member-ledger-detail td { display: block; width: auto; height: auto; min-height: 0; padding: 1px 0; border: 0; font-size: 12px; line-height: 1.4; }
  :is(.member-ledger,.member-ledger-detail) :is(.wf-ledger-time,.member-ledger-name,.member-note) { grid-column: 1; }
  :is(.member-ledger,.member-ledger-detail) .member-number { grid-column: 2; grid-row: 1; }
  :is(.member-ledger,.member-ledger-detail) .member-number:last-child { grid-row: 2; }
  :is(.member-ledger,.member-ledger-detail) .member-number:last-child::before { content: '余额 '; color: #71829a; font-size: 10px; }
}
