:root {
  color-scheme: light;
  --ink: #151d3e;
  --muted: #505976;
  --bg: #eff1f8;
  --nav: #1a223e;
  --accent: #5055dc;
  --accent-dark: #393db2;
  --line: #dfe3f1;
  --input: #c9cedf;
  --surface: #fff;
  font: 16px/1.5 "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .42; }
:focus-visible { outline: 2px solid #7278f1; outline-offset: 3px; }
h1, h2, p { margin: 0; }
h2 { font-size: 1.45rem; line-height: 1.35; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 235px; display: flex; flex-direction: column; background: var(--nav); color: white; padding: 20px 12px; }
.brand { display: flex; flex-direction: column; padding: 0 16px; }
.brand strong { font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; }
.brand span { font-size: 1.18rem; color: #d9def7; }
nav { display: grid; gap: 7px; margin-top: 37px; }
.nav, .sidebar-footer { min-height: 48px; display: flex; align-items: center; gap: 18px; padding: 0 20px; }
.nav { color: white; background: transparent; border: 0; text-align: left; border-radius: 9px; }
.nav:hover { background: #303a5d; }
.nav.active { background: #484db9; font-weight: 700; }
.sidebar-footer { margin-top: auto; color: #e2e5f5; }
[data-icon] { display: inline-flex; align-items: center; flex: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
main { margin-left: 235px; padding: 18px 25px 36px; }
.page-header { padding: 0 10px; margin-bottom: 22px; display: flex; gap: 15px; justify-content: space-between; align-items: start; }
h1 { font-size: clamp(1.85rem, 2.65vw, 2.5rem); font-weight: 800; line-height: 1.22; letter-spacing: -.03em; }
.page-header p { margin-top: 4px; color: var(--muted); font-size: 1.1rem; }
.demo { margin-top: 6px; padding: 3px 13px; border-radius: 20px; background: #dedfff; color: #3e46a9; white-space: nowrap; font-size: .9rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.health { padding: 13px 22px 14px; margin-bottom: 17px; }
.health-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.health-heading h2 { font-size: 1.15rem; }
.health-heading p { color: var(--muted); font-size: .83rem; margin-top: 2px; }
.health-heading button { min-height: 35px; padding-inline: 11px; font-size: .88rem; white-space: nowrap; }
.health-heading svg { width: 16px; height: 16px; }
.health-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.health-card { min-width: 0; padding: 11px 14px 0; }
.health-card:first-child { padding-left: 0; }
.health-card + .health-card { border-left: 1px solid var(--line); }
.health-card header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 9px; }
.health-card header strong { font-size: .96rem; }
.health-card p { margin-top: 3px; color: var(--muted); font-size: .82rem; line-height: 1.35; }
.health-card .health-status { color: #21723a; font-size: .81rem; font-weight: 700; }
.health-card .health-status.warn { color: #955113; }
.health-card .health-status.manual { color: #53617d; }
.filters { padding: 13px 23px 21px; }
.filter-grid { padding: 0; margin: 0; border: 0; display: grid; gap: 18px 24px; grid-template-columns: 1fr 1fr 1.08fr 1.6fr; }
.control { min-width: 0; display: grid; align-content: start; gap: 6px; font-weight: 600; }
input:not([type=checkbox], [type=radio]), select, summary { width: 100%; min-width: 0; height: 41px; border: 1px solid var(--input); background-color: #fcfcfe; border-radius: 7px; padding: 0 13px; font-weight: 500; }
select, summary { padding-right: 32px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m6 8 4 4 4-4' fill='none' stroke='%23151d3e' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; }
select { cursor: pointer; }
details { min-width: 0; position: relative; }
summary { display: flex; align-items: center; cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.choices { border-radius: 8px; padding: 8px; border: 1px solid var(--line); background: white; box-shadow: 0 10px 24px #25295120; position: absolute; top: calc(100% + 5px); min-width: 100%; z-index: 2; }
.choices label, .export-options label { display: flex; gap: 10px; align-items: center; padding: 6px; font-weight: 500; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; flex: none; cursor: pointer; }
.date-range { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; border: 1px solid var(--input); border-radius: 7px; background: #fcfcfe; }
.date-range input[type=date] { border: 0; background: transparent; height: 39px; padding-inline: 9px; font-variant-numeric: tabular-nums; }
.actions { display: flex; gap: 12px; align-self: end; }
.primary, .secondary, .text-button { min-height: 41px; border-radius: 8px; padding: 0 17px; display: inline-flex; justify-content: center; align-items: center; gap: 9px; font-weight: 700; }
.primary { border: 1px solid transparent; color: white; background: var(--accent); }
.primary:hover:not(:disabled) { background: var(--accent-dark); }
.actions .primary { min-width: 125px; }
.secondary { border: 1px solid var(--input); background: white; }
.text-button { padding-inline: 9px; background: transparent; border: 0; color: var(--muted); font-weight: 500; }
.text-button:hover, .secondary:hover { background: #f2f3fb; }
.message { color: #a1450e; margin-top: 10px; font-size: .9rem; }
.totals { display: grid; grid-template-columns: 1.8fr 1fr .96fr; background: #f7f7ff; border: 1px solid #dfe3fa; border-radius: 12px; padding: 16px 0; margin: 22px 0 20px; }
.totals > div { padding: 0 24px; min-width: 0; }
.totals > div + div { border-left: 1px solid #d7d9ee; padding-left: 32px; }
.totals h2 { font-size: 1.1rem; margin-bottom: 5px; }
.totals strong { font-size: 2.05rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.35; }
.money-totals { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; min-height: 44px; }
.money-totals span { display: inline-flex; align-items: baseline; gap: 9px; white-space: nowrap; }
.money-totals span + span { border-left: 1px solid #d7d9ee; padding-left: 16px; }
.money-totals strong { font-size: clamp(1.15rem, 1.65vw, 1.65rem); }
.results { padding: 16px; }
.results-heading { padding-left: 6px; display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.tabs { display: flex; gap: 12px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { background: transparent; border: 0; padding: 9px 17px; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 650; }
.tabs button[aria-pressed=true] { border-bottom-color: var(--accent); color: var(--accent-dark); }
.table-wrap { overflow: auto; }
table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 700px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 8px 13px; white-space: nowrap; border-bottom: 1px solid #e4e7f0; }
th { background: #e9ecf7; font-weight: 700; }
th:first-child { border-top-left-radius: 7px; }
th:last-child { border-top-right-radius: 7px; }
td { font-size: .95rem; }
.select-col { width: 60px; text-align: center; }
.money { text-align: right; }
.money strong { padding-left: 8px; }
.chip { display: inline-block; padding: 1px 10px; border-radius: 7px; color: #165b27; background: #dcf7e1; font-size: .86rem; }
.chip.pending { color: #76451e; background: #fff0d4; }
tr:has(input:checked) td { background: #f3f3ff; }
.empty { text-align: center; padding: 44px 14px; color: var(--muted); white-space: normal; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 6px 4px; font-size: .92rem; }
.pager { display: flex; align-items: center; gap: 10px; }
.pager button, #page-number { display: grid; place-items: center; width: 37px; height: 36px; background: #fbfcff; border: 1px solid var(--line); border-radius: 7px; }
#page-number { background: var(--accent); color: white; border-color: var(--accent); font-weight: 700; }
.pager select { width: auto; height: 36px; }
#sources h2, #exports h2 { margin: 0 6px 16px; }
dialog { color: var(--ink); width: min(460px, calc(100% - 30px)); border: 1px solid var(--line); border-radius: 13px; padding: 24px; box-shadow: 0 20px 60px #11152d25; }
dialog::backdrop { background: #10172c70; }
.dialog-heading, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dialog-heading .close { font-size: 1.6rem; border: 0; background: none; }
dialog p { margin-top: 8px; color: var(--muted); }
.export-options { margin: 23px 0; padding: 0; border: 0; }
.export-options legend { font-weight: 700; }
.dialog-actions { justify-content: flex-end; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 1280px) {
  .filter-grid { grid-template-columns: .95fr .95fr 1fr 2.05fr; gap: 15px; }
  .sidebar { width: 205px; }
  main { margin-left: 205px; }
  .date-range input[type=date] { font-size: .92rem; padding-inline: 6px; }
  th, td { padding-inline: 7px; }
  td { font-size: .92rem; }
  .select-col { width: 38px; }
  .money-totals, .money-totals span { gap: 6px; }
  .money-totals span + span { padding-left: 8px; }
}
@media (max-width: 980px) {
  .filter-grid { grid-template-columns: 1fr 1fr; }
  .totals { grid-template-columns: 1.55fr 1fr 1fr; }
  .totals > div, .totals > div + div { padding-inline: 14px; }
}
@media (max-width: 720px) {
  .sidebar { position: static; width: auto; padding: 12px 14px; }
  .brand { padding: 0; flex-direction: row; align-items: baseline; gap: 10px; }
  .brand strong { font-size: 1.2rem; }
  .brand span { font-size: .9rem; }
  nav { display: flex; gap: 5px; margin-top: 11px; }
  .nav { padding: 0 8px; font-size: .87rem; gap: 5px; min-height: 36px; }
  .nav svg { width: 16px; height: 16px; }
  .sidebar-footer { display: none; }
  main { margin-left: 0; padding: 16px 12px 25px; }
  .page-header { padding: 0 2px; }
  .page-header p { font-size: .9rem; }
  .demo { padding-inline: 8px; }
  .filters { padding: 13px; }
  .health { padding: 13px; }
  .health-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .health-card:nth-child(3) { padding-left: 0; border-left: 0; }
  .filter-grid { gap: 13px 10px; }
  .control:has(.date-range), .search { grid-column: 1 / -1; }
  .totals { grid-template-columns: 1fr 1fr; padding: 12px 0; row-gap: 10px; }
  .totals > div:first-child { grid-column: 1 / -1; }
  .totals > div:nth-child(2) { border: 0; }
  .totals h2 { font-size: .95rem; }
  .totals strong { font-size: 1.35rem; }
  .results { padding: 12px 9px; }
  .results-heading h2 { font-size: 1.18rem; }
  .table-footer { flex-wrap: wrap; }
  .tabs button { padding: 9px 8px; }
}
