.funds-register{font-size:13px;letter-spacing:0}.funds-register h2{font-size:21px;margin:0 0 14px}.fund-toolbar,.fund-fields{display:flex;align-items:end;gap:10px;flex-wrap:wrap}.fund-toolbar label{display:flex;align-items:center;gap:6px}.funds-register input,.funds-register select,.funds-register button{font-size:13px!important;min-height:34px!important;height:34px;padding:5px 9px!important;border:1px solid #d6dfe7;border-radius:5px;background:white;color:#263441}.funds-register button{cursor:pointer;color:#0678ca}.fund-summary{display:flex;gap:18px;align-items:center;padding:14px 0}.fund-summary strong{font-size:21px;color:#07836a}.fund-summary span{color:#788594}.fund-scroll{max-height:520px;overflow:auto;border:1px solid #dce4ea;background:white}.funds-register table{border-collapse:collapse;width:max-content;min-width:100%;table-layout:auto}.funds-register th,.funds-register td{font-size:12px!important;padding:9px 10px!important;min-width:94px;white-space:nowrap;border:1px solid #e1e7ec;text-align:right}.funds-register thead th{background:#eef6fa;text-align:center;position:sticky;top:0;z-index:2}.funds-register thead tr:nth-child(2) th{top:35px}.funds-register tbody th{background:#f8fafb;position:sticky;left:0;text-align:left;z-index:1}.fund-income{color:#07836a;font-weight:600;font-variant-numeric:tabular-nums}.fund-formula{font-size:12px;color:#637688;padding:12px 0}.fund-entry{border-top:1px solid #dce4ea;padding-top:12px}.fund-entry h3{font-size:15px;margin:0 0 10px}.fund-fields label{display:flex;flex-direction:column;gap:6px;font-size:12px}.fund-fields input{width:130px}.fund-fields select{max-width:230px}.fund-status{padding:8px 0;color:#0678ca}

.finance-period-summary{border:1px solid #dbe5ec;background:#fff;margin:0 0 18px;padding:15px 17px 12px;color:#263441;font-size:12px;letter-spacing:0}
.fps-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.finance-period-summary .fps-toolbar button,.finance-period-summary .fps-toolbar input,.finance-period-summary .fps-toolbar select{min-height:32px!important;height:32px!important;font-size:12px!important;border:1px solid #d5e0e8;border-radius:4px;background:#fff;padding:4px 9px!important;color:#33485a}.fps-segment{display:flex;border:1px solid #d5e0e8;border-radius:4px;overflow:hidden}.finance-period-summary .fps-segment button{min-width:43px;border:0;border-right:1px solid #d5e0e8;border-radius:0;padding:0 10px!important}.finance-period-summary .fps-segment button:last-child{border-right:0}.finance-period-summary .fps-segment button.selected{background:#e6f3fb;color:#087fc8;font-weight:700}.fps-date input,.fps-date select{min-width:148px}.fps-shop{min-width:190px;max-width:250px}.fps-spacer{flex:1}.fps-hint{color:#83929e}.finance-period-summary .fps-export{color:#087fc8}.fps-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin:14px 0 0;border:1px solid #dce6ec;border-radius:5px}.fps-metric{padding:13px 16px;border-right:1px solid #dce6ec;min-width:0}.fps-metric:last-child{border-right:0}.fps-metric span{display:block;color:#6c7d8b}.fps-metric strong{display:block;font-size:21px;line-height:1.4;font-variant-numeric:tabular-nums}.fps-metric.sales strong{color:#008578}.fps-metric.arrival strong{color:#25578c}.fps-metric.withdrawal strong{color:#bd5c42}.fps-metric small{color:#8b98a4;font-size:11px}.fps-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:17px 0 9px}.fps-heading h3{font-size:13px;margin:0}.fps-heading span{color:#83919e;font-size:11px}.fps-dot{display:inline-block;width:7px;height:7px;margin:0 3px 0 9px;border-radius:1px}.fps-dot.sales,.fps-bar.sales{background:#13a79c}.fps-dot.arrival,.fps-bar.arrival{background:#6b9bd0}.fps-dot.withdrawal,.fps-bar.withdrawal{background:#d49379}.fps-chart{display:flex;align-items:flex-end;gap:5px;min-height:116px;overflow-x:auto;border-bottom:1px solid #dce6ec;background:linear-gradient(to top,transparent 48%,#edf2f5 48%,#edf2f5 49%,transparent 49%);padding:7px 4px 3px}.fps-chart-item{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:3px;min-width:42px;flex:1;max-width:100px}.fps-bars{height:91px;display:flex;align-items:flex-end;justify-content:center;gap:2px}.fps-bar{display:block;width:8px;min-height:0;border-radius:2px 2px 0 0}.fps-bar.negative{opacity:.55;outline:1px solid #aa4634}.fps-chart-item small{font-size:10px;color:#8a98a5;white-space:nowrap}.fps-empty{margin:auto;color:#8a98a5}.fps-table-wrap{overflow:auto;border:1px solid #dce6ec;max-height:380px}.finance-period-summary table{width:100%;min-width:640px;border-collapse:collapse}.finance-period-summary th,.finance-period-summary td{border:0;border-bottom:1px solid #e6edf1;padding:9px 10px!important;min-width:unset;font-size:11px!important;text-align:right;white-space:nowrap}.finance-period-summary th:first-child,.finance-period-summary td:first-child,.finance-period-summary th:nth-child(2),.finance-period-summary td:nth-child(2){text-align:left}.finance-period-summary thead th{position:sticky;top:0;background:#eef6fa;color:#5d6f7d;z-index:1}.finance-period-summary tbody td:nth-child(3){color:#008578;font-weight:600}.finance-period-summary tbody tr:last-child td{border-bottom:0}.fps-total{background:#f4faf9;font-weight:700}.fps-note{color:#82919e;font-size:11px;margin:9px 0 0;line-height:1.5}
@media(max-width:760px){.fps-metrics{grid-template-columns:1fr}.fps-metric{border-right:0;border-bottom:1px solid #dce6ec}.fps-metric:last-child{border-bottom:0}.fps-shop{max-width:100%}.fps-hint{display:none}.fps-chart-item{min-width:42px;flex:none}}
.fps-date{display:flex;align-items:center;gap:5px}.fps-date-separator{color:#738492;white-space:nowrap}
.fps-negative{display:inline-block;width:8px;color:#b45442;font-size:14px;line-height:12px;text-align:center}

/* Keep fund-register pagination reachable on long daily tables. */
.funds-register .fund-scroll {
  max-height: min(52vh, 460px);
  overscroll-behavior: auto;
}
.finance-period-summary .fps-table-wrap {
  max-height: min(48vh, 380px);
  overscroll-behavior: auto;
}

/* Keep the two header rows as one sticky unit.  Sticking each row separately
   can cover the first body row, which made day 1 look missing. */
.funds-register thead {
  position: sticky;
  top: 0;
  z-index: 3;
}
.funds-register thead th {
  position: static;
  height: 36px;
  box-sizing: border-box;
}
.funds-register thead .fund-date-group,
.funds-register thead tr:nth-child(2) th:first-child {
  position: sticky;
  left: 0;
  z-index: 5;
}
.funds-register .fund-scroll-monthly {
  max-height: none;
  overflow-x: auto;
  overflow-y: hidden;
}
.funds-register .fund-scroll-monthly thead th {
  position: static;
}

/* Month view has no vertical scrolling.  The generic column-filter stylesheet
   changes header cells back to position:relative; if the old 35px sticky
   offset remains, the second header row is painted over the only month row.
   Clear that offset for both Live Funds and Tmall Funds. */
.funds-register .fund-scroll-monthly thead {
  position: static !important;
  top: auto !important;
}
.funds-register .fund-scroll-monthly thead tr:nth-child(2) th {
  top: auto !important;
}

/* Compact funds dashboards to match the information density of Daily Profit. */
.funds-register h2 {
  margin-bottom: 8px;
  font-size: 19px;
}
.finance-period-summary {
  margin-bottom: 10px;
  padding: 9px 11px 7px;
  border-radius: 7px;
}
.fps-toolbar {
  gap: 6px;
}
.finance-period-summary .fps-toolbar button,
.finance-period-summary .fps-toolbar input,
.finance-period-summary .fps-toolbar select {
  min-height: 29px !important;
  height: 29px !important;
  padding: 3px 8px !important;
}
.finance-period-summary .fps-segment button {
  min-width: 38px;
  padding: 0 8px !important;
}
.fps-date input,
.fps-date select {
  min-width: 132px;
}
.fps-shop {
  min-width: 174px;
}
.fps-metrics {
  margin-top: 8px;
}
.fps-metric {
  min-height: 58px;
  padding: 7px 12px 6px;
}
.fps-metric strong {
  display: inline-block;
  margin: 2px 8px 0 0;
  font-size: 18px;
  line-height: 1.15;
}
.fps-metric small {
  display: inline-block;
  font-size: 10px;
}
.fps-heading {
  min-height: 17px;
  margin: 9px 0 4px;
}
.fps-heading h3 {
  font-size: 12px;
}
.fps-chart {
  min-height: 82px;
  height: 82px;
  gap: 3px;
  padding: 3px 3px 2px;
}
.fps-chart-item {
  min-width: 34px;
  gap: 1px;
}
.fps-bars {
  height: 60px;
}
.fps-bar {
  width: 7px;
}
.fps-chart-item small {
  font-size: 9px;
}
.finance-period-summary .finance-table-pager.finance-table-pager-top {
  min-height: 30px;
  height: 30px;
  margin: 4px 0 2px;
  padding: 1px 5px;
  gap: 6px;
  font-size: 11px;
}
.finance-period-summary .finance-table-pager select,
.finance-period-summary .finance-table-pager button {
  height: 25px;
  min-height: 25px !important;
  padding-top: 1px !important;
  padding-bottom: 1px !important;
}
.finance-period-summary .fps-table-wrap {
  max-height: min(42vh, 310px);
}
.finance-period-summary th,
.finance-period-summary td {
  height: 27px;
  padding: 5px 8px !important;
}
.fps-note {
  margin-top: 5px;
  line-height: 1.3;
}

@media(max-width:760px) {
  .fps-metric strong,
  .fps-metric small {
    display: block;
  }
  .fps-chart-item {
    min-width: 34px;
  }
}

/* Horizontal store groups, matching the dense Daily Profit detail table. */
.finance-period-summary .fps-pivot-wrap {
  max-height: none;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 5px;
}
.finance-period-summary .fps-pivot-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
  border-collapse: separate;
  border-spacing: 0;
}
.finance-period-summary .fps-pivot-table thead {
  position: static;
}
#finance .finance-period-summary .fps-pivot-table thead th {
  position: static !important;
  top: auto !important;
  z-index: auto;
}
.finance-period-summary .fps-pivot-table th,
.finance-period-summary .fps-pivot-table td {
  box-sizing: border-box;
  height: 28px;
  min-width: 78px;
  padding: 4px 7px !important;
  border-right: 1px solid #dfe8e7;
  border-bottom: 1px solid #dfe8e7;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.finance-period-summary .fps-pivot-table thead tr:first-child th {
  top: 0;
  height: 30px;
  text-align: center;
}
.finance-period-summary .fps-pivot-table thead tr:nth-child(2) th {
  top: 30px;
  text-align: center;
}
.finance-period-summary .fps-pivot-table .fps-period-col {
  position: sticky !important;
  left: 0;
  top: auto !important;
  min-width: 86px;
  width: 86px;
  text-align: center;
  background: #f4f1ec;
  color: #465563;
  z-index: 4;
}
#finance .finance-period-summary .fps-pivot-table thead .fps-period-col {
  position: sticky !important;
  left: 0;
  top: auto !important;
  z-index: 4;
}
.finance-period-summary .fps-pivot-table tbody .fps-period-col {
  z-index: 2;
}
.finance-period-summary .fps-pivot-table .fps-shop-group {
  min-width: 234px;
  border-left: 2px solid #c8dcd8;
  font-weight: 700;
  color: #40545c;
}
.finance-period-summary .fps-pivot-table .fps-metric-head:nth-child(3n + 1),
.finance-period-summary .fps-pivot-table tbody td:nth-child(3n + 2) {
  border-left: 2px solid #c8dcd8;
}
.finance-period-summary .fps-pivot-table .fps-tone-0 { background: #edf8f4; }
.finance-period-summary .fps-pivot-table .fps-tone-1 { background: #eef6fb; }
.finance-period-summary .fps-pivot-table .fps-tone-2 { background: #fff6e9; }
.finance-period-summary .fps-pivot-table .fps-tone-3 { background: #fff1ed; }
.finance-period-summary .fps-pivot-table .fps-tone-4 { background: #f3f1fa; }
.finance-period-summary .fps-pivot-table .fps-tone-5 { background: #f2f7f5; }
.finance-period-summary .fps-pivot-table .fps-value-sales {
  color: #008578;
  font-weight: 600;
}
.finance-period-summary .fps-pivot-table .fps-value-arrival {
  color: #25578c;
}
.finance-period-summary .fps-pivot-table .fps-value-withdrawal {
  color: #a8523f;
}
.finance-period-summary .fps-rules-button {
  border-color: transparent !important;
  background: transparent !important;
  color: #28725e !important;
  font-weight: 600;
  white-space: nowrap;
}
.finance-period-summary .fps-rules-button:hover,
.finance-period-summary .fps-rules-button:focus-visible {
  text-decoration: underline;
}
.fps-rules-dialog .daily-profit-rules-content {
  max-height: calc(min(84vh, 820px) - 62px);
  overflow-y: auto;
}

/* Funds detail: keep both header rows in the sticky thead.  The finance
   filter rule makes th relative; reset the legacy second-row top:35px so
   it cannot paint over day 1.  Scope this override to funds detail only. */
#finance .funds-register .fund-scroll thead {
  position: sticky;
  top: 0;
  z-index: 3;
}
#finance .funds-register .fund-scroll thead th {
  position: relative;
  top: 0 !important;
}
#finance .funds-register .fund-scroll thead .fund-date-group,
#finance .funds-register .fund-scroll thead tr:nth-child(2) th:first-child {
  position: sticky;
  left: 0;
  z-index: 5;
}
#finance .funds-register .fund-scroll tbody th {
  position: sticky;
  top: auto;
  left: 0;
  z-index: 1;
}
