/* BI workspace: final visual layer shared by MVC and the legacy page shell. */
:root{
 --bi-bg:#f3f5f9;--bi-surface:#fff;--bi-soft:#f8fafc;--bi-text:#1e293b;
 --bi-muted:#66758b;--bi-border:#e2e8f0;--bi-primary:#345ee8;--bi-tint:#eef3ff;
 --bi-hover:#f5f8ff;--bi-success:#168568;--bi-warning:#a96a12;
 font-family:Inter,-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif;
 font-size:14px;background:var(--bi-bg);color:var(--bi-text)
}
:root[data-theme=dark]{--bi-bg:#101722;--bi-surface:#182231;--bi-soft:#1d293a;--bi-text:#e4ebf5;--bi-muted:#a2b0c4;--bi-border:#2e3c50;--bi-primary:#88a6ff;--bi-tint:#253657;--bi-hover:#202e43;--bi-success:#61d2ad;--bi-warning:#edbc70}
body{background:var(--bi-bg);color:var(--bi-text);line-height:1.5}
button,input,select{font-family:inherit}
button,a,input,select,summary{touch-action:manipulation}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible,[tabindex]:focus-visible{outline:3px solid #7898ff;outline-offset:3px}
body>aside{width:224px;padding:28px 16px 20px;background:#18283e;border:0;display:flex;flex-direction:column;gap:0;z-index:100;height:100dvh;overflow-y:auto}
.brand{padding:0 6px;gap:10px;font-size:30px;min-height:42px;color:#8baaff}
.brand span{font-size:18px;letter-spacing:.2px;color:#f2f6fd}
.brand small{font-size:8px;letter-spacing:1.7px;color:#a3b3ca;margin-top:5px}
.space{margin:28px 0 22px;padding:14px;background:#ffffff08;border:1px solid #ffffff0d;border-radius:10px;font-size:11px;color:#9eafc7}
.space b{font-size:13px;color:#e1e9f6;margin-top:6px;font-weight:500}
nav{flex:1}.nav-tree{padding:0;margin:3px 0 10px;border:0}
.nav-tree>summary{font-size:14px;font-weight:500;padding:11px 10px;border-radius:8px;gap:10px;color:#b9c7da}
.nav-tree>summary>span{font-size:19px;width:20px}.nav-tree>summary>i{font-size:12px;color:#8da0bc}
.nav-tree[open]>summary{color:#f4f7fc}
.nav-tree>div{border-left:1px solid #ffffff13;margin:4px 0 0 19px;padding-left:10px}
.nav-tree :is(button,a[data-page]){padding:10px 12px;min-height:40px;margin:3px 0;border-radius:7px;color:#aabbd2}
.nav-tree :is(button,a[data-page]),.nav-tree :is(button,a[data-page]) span{font-size:13px}
.nav-tree :is(button,a[data-page]).active{background:#345ee82e;color:#dfe9ff;box-shadow:inset 3px 0 #7296ff;font-weight:600}
.nav-tree :is(button,a[data-page]):hover,.nav-tree>summary:hover{background:#ffffff08;color:#fff}
.sidebar-foot{position:static;margin-top:28px;padding:16px 8px 0;border-top:1px solid #ffffff10;font-size:11px;color:#9fb0c8}
.sidebar-foot small{margin:7px 0 0;font-size:10px;color:#7288a6}
body>main{margin-left:224px;min-width:0}
main>header{height:64px;padding:0 32px;background:var(--bi-surface);border-bottom:1px solid var(--bi-border);font-size:12px;color:var(--bi-muted)}
main>header b{color:var(--bi-text);font-weight:600}header em{margin:0 12px;color:var(--bi-muted)}
.header-actions{gap:14px}#account-bar{gap:10px;font-size:12px;color:var(--bi-muted)}
#account-bar button{font-size:12px;color:var(--bi-muted);padding:6px 8px}
#account-bar .avatar{width:32px;height:32px;padding:5px;text-align:center;background:var(--bi-tint);color:var(--bi-primary);font-size:14px}
.theme-toggle{width:32px;height:32px;border:1px solid var(--bi-border);background:var(--bi-soft);border-radius:8px;color:var(--bi-muted)}
main>section#content{padding:30px 32px 40px;min-height:calc(100dvh - 64px);max-width:2200px;margin:0 auto}
.heading{align-items:center;gap:20px;margin:0 0 24px}.heading .eyebrow{font-size:10px;letter-spacing:2px;color:var(--bi-muted);margin-bottom:8px}
.heading h1,h1{font-size:26px;font-weight:650;letter-spacing:-.5px;line-height:1.35;margin:0 0 8px;color:var(--bi-text)}
.heading p{font-size:13px;line-height:1.7;color:var(--bi-muted)}
p,.muted,.source-meta,.source-meta small{color:var(--bi-muted)}
.source-meta{font-size:12px}.source-meta small{font-size:11px}
.panel,.card{background:var(--bi-surface);border:1px solid var(--bi-border);border-radius:12px;box-shadow:0 2px 5px #13233d03}
.panel{padding:22px}.panel h2{font-size:16px;color:var(--bi-text);font-weight:600}
.panel-title{gap:20px;align-items:start}.panel-title p{font-size:12px;line-height:1.7;max-width:850px}
.filter-panel{padding:20px 22px;margin-bottom:24px;overflow:visible}
.filters,.ledger-filters,.success-filters{display:flex;flex-wrap:wrap;gap:16px;align-items:flex-end;margin:0}
.filters label,.filters .dr-field>label,.ledger-filters .ledger-filter-field,.ledger-filters .ledger-filter-field>label,.success-site-field>label{font-size:12px;line-height:18px;font-weight:500;color:var(--bi-muted);gap:7px}
.filters>label,.ledger-filter-field,.success-site-field{display:flex;flex-direction:column;min-width:130px;margin:0}
.filters .dr-field,.ledger-filters .dr-field{flex:0 1 300px;min-width:260px;gap:7px}
.filters .shop-picker{min-width:190px;max-width:100%}
.ledger-filters .ledger-filter-field select{width:150px}.ledger-filters .ledger-shop-field{flex:1 1 200px;max-width:300px}
input:not([type=radio]):not([type=checkbox]),select,.filters select,.dr-trigger,.shop-picker-trigger{
 height:40px;min-height:40px;border:1px solid var(--bi-border);border-radius:8px;padding:9px 12px;
 background:var(--bi-surface);color:var(--bi-text);font-size:13px;line-height:20px;box-shadow:none
}
.filters .dr-trigger,.filters .shop-picker-trigger{width:100%;height:40px;background:var(--bi-soft)}
.filters select{background:var(--bi-soft);min-width:130px}.filters input[type=hidden]{display:none}
input::placeholder{color:var(--bi-muted)}
.btn,.filters .btn,.ledger-filters .btn{height:40px;border:1px solid var(--bi-border);border-radius:8px;padding:9px 18px;line-height:20px;font-size:13px;font-weight:500;background:var(--bi-surface);color:var(--bi-text);box-shadow:0 1px 2px #15254006}
.btn:hover{background:var(--bi-soft);border-color:#9aaecb}.btn.primary,.primary.btn{background:#345ee8;color:#fff;border-color:#345ee8}.btn.primary:hover{background:#254bd0;border-color:#254bd0}
.ledger-filter-actions{margin-left:auto;gap:10px}.success-filters>#success-query{margin-left:auto}
.success-type-filter{margin:0;padding:0;border:0}.success-type-filter legend{font-size:12px;color:var(--bi-muted);margin-bottom:7px}
.success-type-filter>div{display:flex;gap:4px;padding:3px;background:var(--bi-soft);border:1px solid var(--bi-border);border-radius:8px;min-height:40px}
.success-type-filter label{display:flex;flex-direction:row;align-items:center;padding:4px 9px;margin:0;gap:5px;font-size:12px;border-radius:5px}
.success-type-filter label:has(input:checked){background:var(--bi-tint);color:var(--bi-primary)}
.report-meta{font-size:14px;font-weight:600;gap:12px;margin:0 0 14px;flex-wrap:wrap;color:var(--bi-text)}.report-meta>span:last-child{font-size:11px;color:var(--bi-muted)}
.overview-card-group .metric-cards.overview-unified{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;margin-bottom:24px}
.overview-card-group .metric-card,.metric-card{display:flex;flex-direction:column;padding:20px;min-height:190px;height:auto;background:var(--bi-surface);border-radius:12px;border-color:var(--bi-border);box-shadow:0 2px 5px #13233d03}
.metric-card label{display:flex;align-items:start;justify-content:space-between;gap:8px;min-height:24px;font-size:13px;font-weight:600;line-height:1.6;color:var(--bi-muted)}
.breakdown-hint{float:none;display:inline;font-size:10px;font-weight:400;line-height:20px;color:var(--bi-primary);white-space:nowrap;margin:0}
.metric-card .metric{height:auto;min-height:40px;font-size:clamp(24px,2.1vw,32px);line-height:1.25;letter-spacing:-.8px;margin:18px 0 20px;color:var(--bi-text);font-weight:650;font-variant-numeric:tabular-nums}
.metric-card .metric>small{font-size:16px;vertical-align:2px;color:var(--bi-muted);font-weight:400}
.metric-card .card-statistics,.metric-card .card-description{margin-top:auto;min-height:64px;padding-top:12px;border-top:1px solid var(--bi-border);font-size:11px;line-height:1.7;color:var(--bi-muted)}
.metric-card .card-statistics>div{display:flex;justify-content:space-between;gap:10px;line-height:1.9;font-size:11px}.metric-card .card-statistics b{font-size:12px;color:var(--bi-text);font-weight:600}
.metric-card[data-receipt-metric]{border-top:3px solid #5479ef;padding-top:18px;background:var(--bi-surface)}
.metric-card[role=button]:hover,.metric-card[role=button]:focus-visible{border-color:#8ba5ed;box-shadow:0 5px 18px #345ee80c}
.shop-panel,.admin-panel{padding:0;overflow:hidden;border-radius:12px}.shop-panel>.panel-title{padding:20px 22px;margin:0;border-bottom:1px solid var(--bi-border);display:flex;flex-wrap:wrap}
.shop-panel h2{font-size:16px;margin:0}.shop-count{font-size:11px;padding:2px 7px;background:var(--bi-tint);color:var(--bi-primary);border-radius:5px}
.table-wrap,.tooltip-scroll{overflow:auto;overscroll-behavior-x:contain;scrollbar-width:thin;scrollbar-color:#b2bfd2 transparent}
main table,dialog table{font-size:13px;font-variant-numeric:tabular-nums;border-collapse:separate;border-spacing:0}
main table th,dialog table th{background:var(--bi-soft);color:var(--bi-muted);font-size:12px;font-weight:600;padding:14px 16px;border-bottom:1px solid var(--bi-border);line-height:1.6}
main table td,dialog table td{font-size:13px;padding:14px 16px;border-bottom:1px solid var(--bi-border);color:var(--bi-text);line-height:1.65}
main table tbody tr:hover>td{background:var(--bi-hover)}
main .statistics-table{table-layout:auto;min-width:1620px;width:100%}
main .statistics-table th,main .statistics-table td{width:auto;min-width:112px;padding:14px;text-align:right}
main .statistics-table th:first-child,main .statistics-table td:first-child{width:200px;min-width:200px;text-align:left;position:sticky;left:0;background:var(--bi-surface);z-index:1;border-right:1px solid var(--bi-border)}
main .statistics-table thead th:first-child{background:var(--bi-soft);z-index:2}
main .statistics-table .shop-name{font-size:13px;line-height:1.6;font-weight:600;color:var(--bi-text);overflow-wrap:normal;white-space:nowrap;margin-bottom:5px}
main .statistics-table td strong,main .statistics-table .count-cell,main .statistics-table tfoot>tr>td:nth-child(2){font-size:15px;font-weight:600;color:var(--bi-text)}
main .statistics-table th .table-sort,main table th>button{font:inherit;line-height:1.5;color:inherit;background:none;border:0;padding:0;white-space:normal;gap:6px}
main .statistics-table td small,.total-note,.daily-subscription-count{font-size:11px;color:var(--bi-muted);line-height:1.6;margin-top:5px}
.team-tag,.status-tag{font-size:10px;line-height:1.6;padding:2px 7px;border-radius:5px;background:var(--bi-soft);color:var(--bi-muted)}
main table tfoot th,main table tfoot td{background:var(--bi-soft);font-weight:600;border-top:1px solid var(--bi-border)}
main .statistics-table tfoot th:first-child,main .statistics-table tfoot td:first-child{background:var(--bi-soft)}
.shop-metric{border-radius:6px}.shop-metric:hover,.shop-metric:focus{background:var(--bi-tint);box-shadow:none}
.success-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:24px}
.success-summary-card{padding:20px;min-width:0;border-radius:12px}.success-summary-card>span{font-size:12px;color:var(--bi-muted)}.success-summary-card>strong{font-size:29px;line-height:1.3;letter-spacing:-.6px;margin-top:14px;color:var(--bi-text)}
.success-type-comparison{padding:22px;margin-bottom:24px}.success-type-comparison>p,.success-chart-layout .panel>p{font-size:12px;color:var(--bi-muted);margin-top:6px}
.success-table{min-width:920px}.success-table td,.success-table th{text-align:right;padding:13px 16px}.success-table td:first-child,.success-table th:first-child{text-align:left}
.success-site{font-size:13px;color:var(--bi-primary)}.success-team{font-size:11px;color:var(--bi-muted)}
.success-type-row[aria-pressed=true]>td{background:var(--bi-tint)}
.success-chart-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.3fr);gap:20px;margin-bottom:24px;align-items:start}
.success-chart-layout>.panel{min-width:0;padding:22px}.success-share-chart{max-width:600px;margin:auto}.success-rings{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:18px}
.success-ring-card{padding:16px;gap:14px;border:1px solid var(--bi-border);border-radius:10px;background:var(--bi-surface);min-width:0}.success-ring-card:hover{background:var(--bi-hover);border-color:#8ba5ed}
.success-ring{width:90px;height:90px;min-width:90px}.success-ring strong{font-size:21px}.success-ring-copy>b{font-size:13px;color:var(--bi-text)}.success-ring-copy>small{font-size:11px;color:var(--bi-muted);line-height:1.7}
.success-share-legend button{font-size:12px;color:var(--bi-text);border-color:var(--bi-border);background:var(--bi-surface);border-radius:8px}.success-share-legend small{font-size:11px;color:var(--bi-muted)}
.success-rules,.report-rules{font-size:12px;line-height:1.8;color:var(--bi-muted);margin:0 0 20px}.report-rules{margin-top:20px;padding:14px 18px;background:var(--bi-soft);border:1px solid var(--bi-border);border-radius:10px}.report-rules summary{color:var(--bi-muted);font-size:12px}.report-rules p{font-size:12px;color:var(--bi-muted);max-width:none;margin-top:10px}
#cost-result .cost-overview{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-bottom:24px}
#cost-result .cost-summary-card{padding:20px;gap:8px;border-radius:12px;min-width:0;min-height:154px;background:var(--bi-surface);border-color:var(--bi-border)}
#cost-result .cost-summary-card>span{font-size:13px;font-weight:600;color:var(--bi-muted)}
#cost-result .cost-overview-card>strong{font-size:32px;letter-spacing:-.6px;color:var(--bi-text)}
#cost-result .cost-net-card{border-top:3px solid #218c78;padding-top:18px}
#cost-result .cost-summary-card>small{font-size:11px;color:var(--bi-muted)}#cost-result .cost-summary-card .cost-missing,#cost-result .cost-missing{color:var(--bi-warning)}
#cost-result .cost-section-heading{margin:0 0 14px}#cost-result .cost-section-heading h2{font-size:15px}#cost-result .cost-section-heading p{font-size:12px;color:var(--bi-muted)}
#cost-result .cost-summary.cost-components{grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:24px}
#cost-result .cost-components .cost-summary-card{min-height:128px}#cost-result .cost-components .cost-summary-card>strong{font-size:25px;color:var(--bi-text)}
main #cost-result .cost-table{table-layout:auto;min-width:1420px;width:100%}
main #cost-result .cost-table th,main #cost-result .cost-table td{padding:14px;min-width:130px!important;width:auto!important;font-size:12px}
main #cost-result .cost-table th:first-child,main #cost-result .cost-table td:first-child{width:200px!important;min-width:200px!important}
#cost-result .cost-table .shop-name{font-size:13px;max-width:none;overflow:visible}.cost-cell{font-family:inherit}#cost-result .cost-cell>strong{font-size:15px;color:var(--bi-text)}#cost-result .cost-cell>small{font-size:11px;line-height:1.6}#cost-result .cost-cell{gap:5px}
#cost-result .shop-panel>.panel-title{padding:20px 22px}#cost-result .shop-panel p{font-size:12px}#cost-result .cost-table td:first-child>small{font-size:11px;color:var(--bi-muted)}
.notice,.cost-warning{background:var(--bi-tint);border-color:var(--bi-border);color:var(--bi-muted);padding:14px 18px;font-size:12px;border-radius:10px;margin-bottom:20px}
dialog,#payment-tooltip,#success-dialog,#cost-dialog,.admin-dialog{background:var(--bi-surface);color:var(--bi-text);border:1px solid var(--bi-border);border-radius:16px;padding:26px;box-shadow:0 24px 80px #08142630;max-height:88dvh}
dialog::backdrop{background:#0b172b66;backdrop-filter:blur(3px)}
#payment-tooltip,#success-dialog,#cost-dialog{width:min(1160px,calc(100vw - 48px))}
dialog h3,#payment-tooltip h3,#success-dialog h3{font-size:20px;color:var(--bi-text);margin:0 42px 12px 0;line-height:1.5}
dialog p,#payment-tooltip p,#success-dialog p{font-size:13px;line-height:1.8;color:var(--bi-muted);margin-bottom:16px}
.payment-close,.dialog-close{width:32px;height:32px;line-height:28px;font-size:26px;color:var(--bi-muted);border-radius:8px;background:var(--bi-soft);border:0}
dialog .tooltip-scroll{max-height:56dvh}dialog .table-wrap{max-height:60dvh}dialog th{position:sticky;top:0;z-index:2}
#success-dialog table{font-size:16px}#success-dialog td{font-size:16px;padding:14px}#success-dialog th{font-size:14px}#success-dialog .success-rings{grid-template-columns:repeat(3,minmax(0,1fr));margin-bottom:20px}#success-dialog .success-ring strong{font-size:26px}
.daily-subscription-summary{gap:12px}.daily-subscription-summary>span{background:var(--bi-soft);border-color:var(--bi-border);border-radius:8px;color:var(--bi-muted);font-size:12px}.daily-subscription-summary strong{color:var(--bi-text);font-size:20px}
.admin-toolbar{padding:20px 22px;font-size:12px;color:var(--bi-muted);border-bottom:1px solid var(--bi-border)}
.admin-table{font-size:13px}.admin-table th{font-size:12px;padding:14px 20px}.admin-table td{font-size:13px;padding:16px 20px;color:var(--bi-text)}.admin-table button{font-size:12px;padding:6px 12px;background:var(--bi-tint);color:var(--bi-primary);border-radius:6px}
.status-tag.enabled{background:#e7f5ee;color:#168568}
#database-config{margin-top:20px}.form-grid{gap:18px 24px}.form-grid label,.admin-dialog label,.login-panel label{font-size:12px;color:var(--bi-muted);gap:7px;margin-bottom:0;display:flex;flex-direction:column}
.form-grid input,.form-grid select,.admin-dialog input,.admin-dialog select{width:100%;font-size:13px;height:40px}
.admin-dialog h2{font-size:20px}.admin-dialog h3{font-size:15px;margin-top:22px}.admin-dialog .form-grid{margin-bottom:20px}.permission-tree{border-color:var(--bi-border);background:var(--bi-soft);padding:14px;border-radius:8px}.permission-node label{flex-direction:row;font-size:13px;gap:8px}.permission-node small{font-size:11px}.dialog-actions{border-color:var(--bi-border);padding-top:18px;margin-top:24px;gap:10px}
.auth-page #content{background:var(--bi-bg);min-height:100dvh;padding:24px;max-width:none}.login-panel{width:430px;max-width:100%;padding:40px;background:var(--bi-surface);border:1px solid var(--bi-border);border-radius:18px;box-shadow:0 16px 60px #1525400d}.login-panel h1{font-size:25px}.login-panel>p{font-size:13px;margin-bottom:26px;color:var(--bi-muted)}.login-panel label{margin-bottom:18px}.login-panel input{font-size:14px;height:44px}.login-panel .btn{font-size:14px;height:44px;margin-top:4px}.login-panel small{font-size:11px;color:var(--bi-muted);margin-top:22px}.login-mark{font-size:36px;color:var(--bi-primary)}
.empty{padding:64px 24px;font-size:13px;line-height:1.8;color:var(--bi-muted)}footer{font-size:11px;padding:18px 32px;color:var(--bi-muted)}
.dr-popup,.shop-picker-popup,.theme-menu{background:var(--bi-surface);color:var(--bi-text);border-color:var(--bi-border);box-shadow:0 14px 42px #0d1c3524;border-radius:12px}
.dr-popup{font-size:13px}.dr-popup .dr-month{font-size:15px}.dr-popup .dr-grid button{font-size:13px;min-height:32px}.dr-popup .dr-grid span{font-size:12px}.dr-popup .dr-footer button{font-size:12px}.dr-popup .dr-quick button{font-size:12px}
.shop-options label{font-size:13px}.shop-picker-tools{font-size:11px}.shop-picker-popup .shop-search{font-size:13px}.theme-menu button{font-size:12px;color:var(--bi-text)}
@media(min-width:1800px){.overview-card-group .metric-cards.overview-unified{grid-template-columns:repeat(6,minmax(0,1fr))}.success-summary{grid-template-columns:repeat(7,minmax(0,1fr))}#cost-result .cost-summary.cost-components{grid-template-columns:repeat(6,minmax(0,1fr))}}
@media(max-width:1250px){body>aside{width:200px;padding:24px 12px}.brand span{font-size:16px}.brand small{font-size:7px}body>main{margin-left:200px}main>section#content{padding:24px}.overview-card-group .metric-cards.overview-unified{grid-template-columns:repeat(3,minmax(0,1fr))}.success-chart-layout{grid-template-columns:1fr}.success-rings{grid-template-columns:repeat(3,minmax(0,1fr))}.success-summary{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:960px){.overview-card-group .metric-cards.overview-unified{grid-template-columns:repeat(2,minmax(0,1fr))}.success-rings{grid-template-columns:repeat(2,minmax(0,1fr))}#success-dialog .success-rings{grid-template-columns:repeat(2,minmax(0,1fr))}.success-summary{grid-template-columns:repeat(3,minmax(0,1fr))}.ledger-filter-actions{margin-left:0}#cost-result .cost-overview{gap:12px}#cost-result .cost-overview-card>strong{font-size:26px}}
@media(max-width:700px){body>aside{width:62px;padding:18px 6px}.brand{padding:0 6px;font-size:27px}.brand span,.space,.sidebar-foot{display:none}nav{margin-top:22px}.nav-tree>summary{padding:10px 12px;gap:0;font-size:0}.nav-tree>summary>span{font-size:20px}.nav-tree>summary>i{display:none}.nav-tree>div{margin:0;padding:0;border:0}.nav-tree :is(button,a[data-page]){padding:8px 3px;text-align:center;min-height:36px;font-size:10px;line-height:1.5}.nav-tree :is(button,a[data-page]) span{display:inline;font-size:10px}.nav-tree :is(button,a[data-page]).active{box-shadow:inset 2px 0 #7296ff}body>main{margin-left:62px}main>header{padding:0 16px;height:56px}main>header>span{display:none}#account-bar{font-size:11px;gap:3px}#account-bar button{font-size:11px;padding:5px}main>section#content{padding:22px 16px;min-height:calc(100dvh - 56px)}.heading{margin-bottom:20px;gap:12px;flex-wrap:wrap}.heading h1{font-size:23px}.heading p{font-size:12px}.heading .eyebrow{font-size:9px}.filter-panel{padding:16px;margin-bottom:20px}.filters,.ledger-filters,.success-filters{gap:12px}.filters>label,.ledger-filters .ledger-filter-field,.ledger-filters .ledger-shop-field,.filters .dr-field,.success-site-field{flex:1 1 100%;width:100%;max-width:none;min-width:0}.filters .dr-trigger,.ledger-filters .ledger-filter-field select,.filters select,.filters .shop-picker{width:100%;max-width:none}.ledger-filter-actions{display:flex;width:100%}.ledger-filter-actions>.btn{flex:1}.success-filters>#success-query{margin-left:0;flex:1}.overview-card-group .metric-cards.overview-unified{gap:10px}.overview-card-group .metric-card{padding:15px;min-height:180px}.metric-card label{font-size:12px;flex-wrap:wrap;gap:2px}.breakdown-hint{font-size:9px}.metric-card .metric{font-size:24px;margin:14px 0}.metric-card .card-statistics>div{font-size:10px}.metric-card .card-statistics b{font-size:11px}.success-summary{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.success-summary-card{padding:16px}.success-summary-card>strong{font-size:24px}.success-rings,#success-dialog .success-rings{grid-template-columns:1fr}.success-chart-layout>.panel{padding:16px}.report-meta{font-size:12px}.report-meta>span:last-child{font-size:10px}#cost-result .cost-overview,#cost-result .cost-summary.cost-components{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}#cost-result .cost-overview>.cost-summary-card:first-child{grid-column:1/-1}#cost-result .cost-summary-card{padding:16px;min-height:138px}#cost-result .cost-overview-card>strong{font-size:26px}#cost-result .cost-components .cost-summary-card>strong{font-size:23px}.form-grid{grid-template-columns:1fr}.admin-toolbar{padding:16px;gap:12px}.admin-toolbar input[type=search]{width:100%;min-width:0}.panel{padding:18px}.shop-panel,.admin-panel{padding:0}dialog,#payment-tooltip,#success-dialog,#cost-dialog{width:calc(100vw - 24px);max-width:none;padding:20px 16px;border-radius:12px}.login-panel{padding:28px}.auth-page main{margin:0}.auth-page #content{padding:20px;min-height:100dvh}.source-meta{text-align:left}.shop-panel>.panel-title{padding:16px}}
@media(max-width:420px){.overview-card-group .metric-cards.overview-unified{grid-template-columns:1fr!important}#account-bar .avatar{display:none}.metric-card .metric{font-size:30px}}
/* Retain true table columns on narrow screens; scrolling belongs to the wrapper. */
main .statistics-table,main #cost-result .cost-table{display:table}
main .statistics-table thead{display:table-header-group}main .statistics-table tbody{display:table-row-group}main .statistics-table tfoot{display:table-footer-group}
main .statistics-table tr{display:table-row}main .statistics-table th,main .statistics-table td{display:table-cell}
main .statistics-table td::before{display:none}
.overview-card-group .overview-unified .metric-card{display:flex;flex-direction:column;min-height:190px;padding:20px}
.overview-card-group .overview-unified .metric-card>label{font-size:13px;line-height:1.6;min-height:24px;align-items:start}
.overview-card-group .overview-unified .metric-card>.metric{font-size:clamp(24px,2.1vw,32px);margin:18px 0 20px;line-height:1.25}
.overview-card-group .overview-unified .metric-card>.card-statistics,.overview-card-group .overview-unified .metric-card>.card-description{min-height:64px;font-size:11px;padding-top:12px}
.overview-card-group .overview-unified .metric-card .breakdown-hint{font-size:10px}
.success-filters .success-type-filter label{font-size:12px}
.success-share-chart{width:100%;height:auto;max-width:600px;margin:20px auto}
.admin-dialog{overflow:auto}.admin-dialog .permission-node label{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:8px;margin:0;padding:7px 0}
.admin-dialog .permission-node input[type=checkbox]{width:16px;height:16px;min-height:16px;padding:0;flex:0 0 16px;margin:0}
@media(max-width:700px){.overview-card-group .overview-unified .metric-card{padding:15px;min-height:180px}.overview-card-group .overview-unified .metric-card>.metric{font-size:24px;margin:14px 0}.overview-card-group .overview-unified .metric-card>label{font-size:12px}}
/* Modal layout: fixed heading, one vertical reading area, independent wide tables. */
#payment-tooltip,#success-dialog,#cost-dialog{padding:0;overflow:hidden;width:min(1320px,calc(100vw - 64px));max-height:90dvh;border-radius:16px}
#payment-tooltip[open],#success-dialog[open],#cost-dialog[open]{display:flex;flex-direction:column}
.bi-dialog-heading{position:relative;flex:none;padding:24px 76px 22px 28px;border-bottom:1px solid var(--bi-border);background:var(--bi-surface)}
#payment-tooltip .bi-dialog-heading h3,#success-dialog .bi-dialog-heading h3,#cost-dialog .bi-dialog-heading h3{font-size:21px;font-weight:650;line-height:1.5;margin:0;color:var(--bi-text);overflow-wrap:anywhere}
.bi-dialog-heading .payment-close{position:absolute;right:24px;top:22px;float:none;width:34px;height:34px;font-size:25px;background:var(--bi-soft);color:var(--bi-muted)}
.bi-dialog-body{min-height:0;overflow:auto;overscroll-behavior:contain;padding:24px 28px 28px;scrollbar-width:thin;scrollbar-color:#a6b5cb transparent}
#payment-tooltip .bi-dialog-body>p,#success-dialog .bi-dialog-body>p,#cost-dialog .bi-dialog-body>p{font-size:13px;line-height:1.85;margin:0 0 20px;color:var(--bi-muted);max-width:1080px}
#payment-tooltip .bi-dialog-body>h3{font-size:16px;line-height:1.5;margin:28px 0 14px;padding-left:12px;border-left:3px solid var(--bi-primary)}
.bi-dialog-body .tooltip-scroll,.bi-dialog-body .table-wrap,.bi-dialog-table{max-height:none;overflow-x:auto;overflow-y:visible;border:1px solid var(--bi-border);border-radius:10px;margin:0 0 20px;scrollbar-width:thin}
#payment-tooltip .bi-dialog-body table{width:100%;min-width:760px;table-layout:auto}
#payment-tooltip .bi-dialog-body table:has(th:nth-child(9)){min-width:1120px}
#payment-tooltip .bi-dialog-body th,#payment-tooltip .bi-dialog-body td{font-size:14px;line-height:1.6;padding:14px 16px;text-align:right;white-space:nowrap;border-bottom:1px solid var(--bi-border);color:var(--bi-text)}
#payment-tooltip .bi-dialog-body th{font-size:12px;color:var(--bi-muted);background:var(--bi-soft);font-weight:600;position:static}
#payment-tooltip .bi-dialog-body th:first-child,#payment-tooltip .bi-dialog-body td:first-child{text-align:left;min-width:180px;white-space:normal;overflow-wrap:anywhere}
#payment-tooltip .bi-dialog-body td:not(:first-child){font-weight:500;font-variant-numeric:tabular-nums}
#payment-tooltip .bi-dialog-body th .payment-sort{font-size:inherit;text-align:inherit;line-height:1.6;white-space:normal;justify-content:flex-end;background:none;border:0;color:inherit;padding:0;gap:6px}
#payment-tooltip .bi-dialog-body th:first-child .payment-sort{justify-content:flex-start}
.bi-dialog-body tbody tr:hover td{background:var(--bi-hover)}
.bi-dialog-body tfoot td,.bi-dialog-body tfoot th{background:var(--bi-soft);font-weight:650!important}
#payment-tooltip .daily-subscription-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;background:none;padding:0;border:0;margin:0 0 24px}
#payment-tooltip .daily-subscription-summary>span{display:flex;flex-direction:column;gap:10px;min-width:0;padding:18px 20px;border:1px solid var(--bi-border);border-radius:10px;font-size:12px;background:var(--bi-soft);color:var(--bi-muted)}
#payment-tooltip .daily-subscription-summary strong{display:block;font-size:26px;line-height:1.3;letter-spacing:-.4px;color:var(--bi-text);font-variant-numeric:tabular-nums}
.bi-dialog-body .daily-period{font-size:13px;border:1px solid var(--bi-border);background:var(--bi-surface);color:var(--bi-muted);padding:6px 12px;border-radius:6px}
.bi-dialog-body .daily-period[aria-pressed=true]{background:var(--bi-tint);color:var(--bi-primary);border-color:var(--bi-primary);font-weight:600}
.bi-dialog-body .payment-tree-toggle{font-size:14px;font-weight:600;color:var(--bi-primary);line-height:1.7}
#success-dialog .bi-dialog-body>.table-wrap{border:0}
#success-dialog .success-rings{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:0 0 24px}
#success-dialog .success-ring-card{padding:16px;border-radius:10px;gap:16px;min-height:122px}
#success-dialog .success-ring{flex:0 0 96px;width:96px;height:96px}
#success-dialog .success-ring strong{font-size:24px}#success-dialog .success-ring strong small{font-size:12px}
#success-dialog .success-ring-copy{gap:4px}#success-dialog .success-ring-copy>b{font-size:15px}#success-dialog .success-ring-copy>small{font-size:12px;line-height:1.7}
#success-dialog .bi-dialog-table table{min-width:1050px;width:100%;table-layout:auto}
#success-dialog .bi-dialog-table th,#success-dialog .bi-dialog-table td{padding:15px 16px;text-align:right;white-space:nowrap}
#success-dialog .bi-dialog-table th{font-size:13px;line-height:1.6;position:static;background:var(--bi-soft)}
#success-dialog .bi-dialog-table td{font-size:16px;line-height:1.7}
#success-dialog .bi-dialog-table th:first-child,#success-dialog .bi-dialog-table td:first-child{text-align:left;min-width:220px;white-space:normal;overflow-wrap:anywhere}
#success-dialog .bi-dialog-footnote{font-size:12px!important;padding:14px 16px;background:var(--bi-soft);border-radius:8px;margin-bottom:0!important}
#cost-dialog .cost-detail-table{min-width:850px;width:100%}
#cost-dialog .cost-detail-table th,#cost-dialog .cost-detail-table td{padding:14px 16px;font-size:14px;line-height:1.7;vertical-align:top}
#cost-dialog .cost-detail-table th{font-size:12px;position:static}
#cost-dialog .cost-detail-table td:last-child{white-space:normal;min-width:280px;color:var(--bi-muted)}
#cost-dialog .cost-detail-table td:nth-child(3){font-weight:600}
#admin-dialog.admin-dialog{padding:0;width:min(800px,calc(100vw - 48px));overflow:hidden;max-height:90dvh}
#admin-dialog>form{display:flex;flex-direction:column;max-height:calc(90dvh - 2px);min-height:0}
#admin-dialog .dialog-heading{padding:22px 28px;margin:0;border-bottom:1px solid var(--bi-border);flex:none;gap:20px;background:var(--bi-surface)}
#admin-dialog .dialog-heading h2{font-size:21px;line-height:1.5;margin:0}
#admin-dialog .bi-dialog-body{padding:24px 28px;flex:1;min-height:0}
#admin-dialog .dialog-actions{margin:0;padding:16px 28px;background:var(--bi-soft);border-top:1px solid var(--bi-border);flex:none}
#admin-dialog .dialog-actions .btn{min-width:88px}
#admin-dialog .form-grid{gap:20px 24px;margin-bottom:22px}
#admin-dialog label{font-size:13px;line-height:1.6;gap:8px}
#admin-dialog .bi-dialog-body>label{margin-bottom:20px}
#admin-dialog h3{font-size:15px;margin:24px 0 10px}#admin-dialog .bi-dialog-body>p{font-size:12px;margin-bottom:16px;color:var(--bi-muted)}
#admin-dialog .permission-tree{max-height:300px;padding:12px 16px;margin-top:14px;background:var(--bi-soft)}
#admin-dialog .permission-node label{font-size:13px;min-height:34px;padding:7px 0;margin:0;flex-direction:row}
#admin-dialog .permission-node input[type=checkbox]{width:16px;height:16px;min-height:16px;flex:0 0 16px}
@media(max-width:1000px){#success-dialog .success-rings{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){#payment-tooltip,#success-dialog,#cost-dialog,#admin-dialog.admin-dialog{width:calc(100vw - 20px);max-height:94dvh;border-radius:12px}.bi-dialog-heading{padding:18px 58px 18px 18px}#payment-tooltip .bi-dialog-heading h3,#success-dialog .bi-dialog-heading h3,#cost-dialog .bi-dialog-heading h3{font-size:17px}.bi-dialog-heading .payment-close{right:14px;top:16px}.bi-dialog-body{padding:18px}.bi-dialog-body .tooltip-scroll,.bi-dialog-table{border-radius:8px}#payment-tooltip .daily-subscription-summary{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}#payment-tooltip .daily-subscription-summary>span{padding:14px;font-size:11px}#payment-tooltip .daily-subscription-summary strong{font-size:21px}#success-dialog .success-rings{grid-template-columns:1fr}#success-dialog .success-ring-card{min-height:112px}#admin-dialog>form{max-height:calc(94dvh - 2px)}#admin-dialog .dialog-heading{padding:18px}#admin-dialog .dialog-heading h2{font-size:18px}#admin-dialog .bi-dialog-body{padding:18px}#admin-dialog .dialog-actions{padding:14px 18px}#admin-dialog .form-grid{grid-template-columns:1fr}}
/* Readability: wrap labels and identifiers, keep numeric values intact. */
#payment-tooltip .bi-dialog-body th,#success-dialog .bi-dialog-table th{white-space:normal;min-width:100px;max-width:180px;overflow-wrap:normal;word-break:normal}
#payment-tooltip .bi-dialog-body th .payment-sort{white-space:normal;overflow-wrap:normal}
#payment-tooltip .bi-dialog-body td:first-child .payment-tree-toggle{max-width:100%;white-space:normal;overflow-wrap:anywhere;text-align:left}
#payment-tooltip .bi-dialog-body td:first-child small{display:block;font-size:12px;line-height:1.7}
#success-dialog .success-tree-label{align-items:flex-start;line-height:1.7}
#success-dialog .success-tree-label>span:last-child{overflow-wrap:anywhere;white-space:normal;min-width:0}
#success-dialog .success-ring{flex-basis:112px;width:112px;height:112px}
#success-dialog .success-ring strong{font-size:26px}
#cost-dialog .cost-detail-table td:nth-child(1),#cost-dialog .cost-detail-table td:nth-child(2){white-space:normal;overflow-wrap:anywhere;min-width:180px}
#cost-dialog .cost-detail-table td:nth-child(3){white-space:nowrap;min-width:120px}
.bi-dialog-heading h3,.bi-dialog-body p{overflow-wrap:anywhere;white-space:normal}
#admin-dialog .permission-node label{white-space:normal;overflow-wrap:anywhere;align-items:flex-start}
#admin-dialog .permission-node input[type=checkbox]{margin-top:3px}
@media(max-width:700px){#payment-tooltip .daily-subscription-summary>span:first-child{grid-column:1/-1}.bi-dialog-table::before,.bi-dialog-body .tooltip-scroll::before,.bi-dialog-body .table-wrap::before{content:'左右滑动查看完整表格';display:block;position:sticky;left:0;width:calc(100vw - 58px);padding:10px 14px;font-size:11px;color:var(--bi-muted);background:var(--bi-soft);border-bottom:1px solid var(--bi-border)}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}

/* HEYBA navigation sizing, tree and icons. */
body>aside{width:250px;padding:20px 12px}
body>main{margin-left:250px}
body>aside .brand{padding:0 8px 20px;min-height:64px}
body>aside .brand span{font-size:18px}
body>aside .brand small{font-size:8px;letter-spacing:1.4px}
body>aside nav{margin-top:8px}
#nav .nav-tree{margin:3px 0;padding:0;border:0}
#nav .nav-tree>summary,#nav :is(button,a[data-page]){display:flex;align-items:center;gap:9px;min-height:42px;padding:10px 12px;margin:3px 0;border-radius:11px;font-size:14px;text-align:left;color:#b1bed2}
#nav .nav-text{width:auto;margin:0;font-size:14px;line-height:1.5;white-space:normal}
#nav .nav-icon{width:18px;height:18px;flex:0 0 18px}
#nav .nav-arrow{width:13px;height:13px;flex:none;margin-left:auto;fill:none;stroke:currentColor;stroke-width:1.8;transition:transform .18s}
#nav .nav-tree[open]>summary .nav-arrow{transform:rotate(90deg)}
#nav .nav-tree>div{margin:0 0 0 7px;padding-left:9px;border-left:1px solid #ffffff12}
#nav .nav-tree>div :is(button,a[data-page]){min-height:38px}
#nav .nav-tree>summary:hover,#nav :is(button,a[data-page]):hover{color:#fff;background:#ffffff0f}
#nav :is(button,a[data-page]).active{color:#fff;background:linear-gradient(90deg,#3e6fff52,#3e6fff17);box-shadow:inset 3px 0 #5d87ff}
main>header>.breadcrumb{display:flex;align-items:center;gap:10px}
#sidebar-toggle{border:0;background:none;color:inherit;padding:6px;display:inline-flex;align-items:center;justify-content:center}
#sidebar-toggle svg{width:18px;height:18px}
body.sidebar-collapsed>aside{width:74px;padding:20px 8px}
body.sidebar-collapsed>main{margin-left:74px}
body.sidebar-collapsed .brand span,body.sidebar-collapsed .sidebar-foot,body.sidebar-collapsed #nav .nav-text,body.sidebar-collapsed #nav .nav-arrow{display:none}
body.sidebar-collapsed #nav .nav-tree>div{padding:0;margin:0;border:0}
body.sidebar-collapsed #nav :is(button,a[data-page]),body.sidebar-collapsed #nav summary{justify-content:center;padding:10px}
body.sidebar-collapsed .brand{justify-content:center;padding:0 0 20px}
/* Compact payment share chart and rate labels. */
.success-share-chart{max-width:450px;margin:10px auto}
.success-ring strong{font-size:17px}
.success-ring strong small{font-size:10px}
.success-share-total{margin:8px 0 12px}
.success-share-legend{row-gap:6px}
@media(max-width:700px){body>aside{width:250px;transform:translateX(-100%)}body>main,body.sidebar-collapsed>main{margin-left:0}body.sidebar-collapsed>aside{width:250px;transform:none}body.sidebar-collapsed .brand span,body.sidebar-collapsed #nav .nav-text,body.sidebar-collapsed #nav .nav-arrow{display:block}body.sidebar-collapsed #nav :is(button,a[data-page]),body.sidebar-collapsed #nav summary{justify-content:flex-start}body.sidebar-collapsed #nav .nav-tree>div{margin-left:7px;padding-left:9px;border-left:1px solid #ffffff12}body.sidebar-collapsed .brand{justify-content:flex-start}body>aside .brand span{display:block}body>aside .brand small{display:block}main>header>.breadcrumb{display:flex;font-size:12px}.success-share-chart{max-width:100%}}

@media(min-width:1251px){.overview-card-group .overview-unified .metric-card{padding:14px}.overview-card-group .overview-unified .metric-card>.metric{font-size:clamp(20px,1.6vw,28px)}}
/* Navigation links retain the same presentation as menu buttons. */
#nav a[data-page],#nav a[data-page]:link,#nav a[data-page]:visited,#nav a[data-page]:hover,#nav a[data-page]:active,#nav a[data-page]:focus{display:flex;align-items:center;text-decoration:none}
#nav a[data-page] .nav-text{text-decoration:none}

/* 弹窗数字、筛选箭头及导航交互修正 */
#success-dialog .success-ring strong{font-size:20px;white-space:nowrap;line-height:1}
#success-dialog .success-ring strong small{font-size:10px;margin-left:1px}
#success-dialog .success-back{margin-bottom:16px}
.filters select{appearance:none;padding-right:34px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238393aa' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 14px center}
.filters .shop-picker-trigger{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-right:14px}
.filters .shop-picker-trigger>span:last-child{flex:none;line-height:1;margin-left:auto}
#nav .nav-tree>summary{list-style:none}
#nav .nav-tree>summary::-webkit-details-marker{display:none}
