:root {
  --tblr-font-sans-serif: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --ink:#22283b; --muted:#667187; --line:#e0e5ee; --accent:#5652bd; --page:#f5f6fa;
}
body { background:var(--page); color:var(--ink); font-family:var(--tblr-font-sans-serif); }
a { color:var(--accent); text-decoration:none; }
a:hover { text-decoration:none; }
[hidden] { display:none!important; }
:focus-visible { outline:3px solid #8c88ee; outline-offset:2px; }
.skip { position:fixed; left:1rem; top:-5rem; z-index:20; background:white; padding:.7rem; }
.skip:focus { top:.5rem; }
.initial,.loading,.empty { color:var(--muted); padding:30px 12px; text-align:center; }
.shell { display:grid; grid-template-columns:216px minmax(0,1fr); min-height:100vh; }
.sidebar { position:sticky; top:0; height:100dvh; display:flex; flex-direction:column; background:#fff; border-right:1px solid var(--line); padding:0 14px; z-index:3; overflow-y:auto; scrollbar-width:thin; }
.brand { display:flex; align-items:center; gap:11px; min-height:77px; padding:0 13px; color:var(--ink); }
.brand strong { font-size:19px; font-weight:720; letter-spacing:.035em; }
.brand-mark { width:34px; height:34px; display:inline-grid; place-items:center; background:var(--accent); color:white; border-radius:10px; }
.brand-mark .ui-icon { width:23px; height:23px; }
.ui-icon { display:inline-block; width:19px; height:19px; flex:none; vertical-align:middle; }
.nav-group { margin:12px 0 8px; }
.nav-group+.nav-group { margin-top:16px; }
.nav-label { padding-left:14px; margin:0 0 5px; font-size:11px; color:#727c90; font-weight:650; letter-spacing:.06em; }
.nav-toggle { display:flex; align-items:center; justify-content:space-between; width:100%; padding:6px 10px 6px 14px; border:0; border-radius:6px; background:none; cursor:pointer; text-align:left; font-family:inherit; }
.nav-toggle:hover { background:#f5f5fa; color:#4a5366; }
.nav-toggle .ui-icon { width:14px; height:14px; transition:transform .15s; }
.nav-group.open .nav-toggle .ui-icon { transform:rotate(90deg); }
.nav-group { margin:4px 0; }
.nav-group+.nav-group { margin-top:4px; }
.sidebar .nav-link { display:flex; justify-content:flex-start; gap:13px; padding:7px 14px; min-height:33px; color:#4a5366; border-radius:6px; font-weight:520; }
.sidebar .nav-link .ui-icon { width:17px; height:17px; color:#697489; }
.sidebar .nav-link:hover { background:#f5f5fa; }
.sidebar .nav-link.active { background:#eeedfc; color:#4844ae; font-weight:650; }
.sidebar .nav-link.active .ui-icon { color:inherit; }
.sidebar-bottom { margin-top:auto; display:flex; align-items:center; gap:8px; padding:20px 12px; font-size:12px; color:var(--muted); }
.sidebar-bottom .ui-icon { width:15px; height:15px; }
.content,main,.panel,.dashboard-grid>* { min-width:0; }
.topbar { min-height:62px; padding:10px clamp(18px,3vw,40px); display:flex; align-items:center; justify-content:space-between; background:#fff; border-bottom:1px solid var(--line); }
.crumb,.account,.actions,.heading,.chart-head,.pagination,.row-actions,.chart-legend { display:flex; align-items:center; gap:10px; }
.crumb,.account { color:var(--muted); font-size:13px; }.crumb a,.account a { color:inherit; }
.crumb .ui-icon { width:15px; height:15px; }.crumb .ui-icon:nth-last-child(1) { width:12px; }
.account .avatar { background:#eae9fc; color:var(--accent); font-weight:bold; }
.btn.menu-toggle { display:none; }
main { max-width:1660px; margin:0 auto; padding:32px clamp(18px,3vw,40px) 50px; }
.heading,.chart-head,.pagination { justify-content:space-between; gap:16px; }.heading,.actions,.row-actions { flex-wrap:wrap; }
.heading { margin-bottom:22px; }
h1 { font-size:clamp(25px,2.4vw,33px); line-height:1.3; margin:0; letter-spacing:-.045em; font-weight:700; }
.sub,.muted,.note { color:var(--muted); }.sub { margin:5px 0 0; font-size:13px; }
.note { display:block; margin-top:4px; font-size:12px; }
.btn { font-weight:560; }.btn-primary { --tblr-btn-bg:#5652bd; --tblr-btn-border-color:#5652bd; --tblr-btn-hover-bg:#45419f; --tblr-btn-hover-border-color:#45419f; --tblr-btn-active-bg:#45419f; }
.btn .ui-icon { width:16px;height:16px; margin:0 4px 0 0; }
.card { --tblr-card-border-color:var(--line); border-radius:12px; box-shadow:0 2px 6px #20243c06; }
.panel { padding:20px 22px; margin-bottom:18px; }
.card-title { margin:0; font-size:17px; font-weight:680; line-height:1.45; }
.panel-title,.chart-head { margin-bottom:16px; }
.stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:18px; }
.metric { display:block; padding:16px 18px 15px; color:var(--ink); }
a.metric:hover { border-color:#b5b1e0; color:var(--ink); }
.metric-top,.status-row,.legend-item { display:flex; align-items:center; }.metric-top { justify-content:space-between; gap:5px; color:#525d73; font-weight:550; }
.metric-icon { display:inline-grid; place-items:center; width:33px; height:33px; border-radius:9px; flex:none; }
.violet { background:#efedfc; color:#6860bf; }.teal { background:#e4f3f1;color:#227a73; }.amber{background:#fff0de;color:#a76518;}.blue{background:#eaf0fc;color:#456cb1;}.plain{background:#f0f2f8;color:#57627a;}
.stat-value { display:block; font-size:clamp(28px,3vw,37px); line-height:1.2; font-weight:640; font-variant-numeric:tabular-nums; letter-spacing:-.045em; margin:7px 0; }
.metric-foot,.axis-label,.chart-legend { color:var(--muted); font-size:12px; }
.dashboard-grid { display:grid; grid-template-columns:minmax(0,1.7fr) minmax(265px,1fr); gap:16px; }
.chart-head select,.actions input[type=date],.actions input[type=month] { width:auto; max-width:100%; }
.chart-head { align-items:flex-start; }.chart-head select { font-size:13px; min-width:100px; }
.chart-host { width:100%; margin:8px 0 0; }.trend-plot { width:100%; height:auto; max-height:238px; display:block; }
.axis-label { fill:#606b7f; font-family:var(--tblr-font-sans-serif); font-size:12px; }
.chart-grid { stroke:#e1e6ef; stroke-dasharray:4 4; }
.chart-line { stroke-width:2.7; stroke-linejoin:round; stroke-linecap:round; }
.line-0 { stroke:#645dc1; }.line-1 { stroke:#258e86; stroke-dasharray:5 5; }.dot-0 { fill:#645dc1; }.dot-1 { fill:#258e86; }
.chart-dot { opacity:0; }.chart-dot:hover,.chart-dot:only-child { opacity:1; }
.chart-legend { justify-content:center; gap:20px; margin-top:auto; }.legend-item { gap:6px; }.legend-dot { width:9px; height:9px; border-radius:50%; }.tint-0{background:#645dc1;}.tint-1{background:#258e86;}
.status-row { gap:12px; min-height:50px; border-bottom:1px solid #edf0f5; color:var(--ink); }.status-row:last-child { border:0; }.status-row:hover { color:var(--accent); }.status-row b { margin-left:auto; font-variant-numeric:tabular-nums; }.status-row>.ui-icon { width:14px; color:#818b9d; }.status-row .metric-icon { width:28px;height:28px; }.status-row .metric-icon .ui-icon { width:16px; }
.quick-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }.quick-grid .status-row { border:1px solid var(--line); border-radius:8px; padding:8px 12px; }
.summary-groups { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px; }
.totals-list { margin:12px 0 0; }.totals-list>div { display:flex;justify-content:space-between;gap:5px;padding:8px 0;border-bottom:1px solid #eef0f5; }.totals-list>div:last-child { border:0; }.totals-list dt { font-weight:450;color:#5f687c; }.totals-list dd { margin:0;font-variant-numeric:tabular-nums; }
.table-wrap { width:100%; overflow-x:auto; }.table-wrap .table { margin:0; }.table-wrap th { white-space:nowrap; }.table-wrap a { white-space:nowrap; }
.badge { background:#ebedf3;color:#525e74; }.badge.active{background:#e4f4ec;color:#22674a;}.badge.draft{background:#fff0d9;color:#855818;}
.code { font-family:monospace; }.pagination { margin:14px 0 0;color:var(--muted);font-size:13px; }
.form-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px 18px; }
.field { display:block;min-width:0; }.field>span,legend { display:block;font-size:14px;font-weight:570;margin-bottom:5px; }
.stack>*+* { margin-top:16px; }.actions .form-control { min-width:140px; }.inline-check { display:flex;align-items:center;gap:5px; }fieldset { border:0;margin:0;padding:0;min-width:0; }
.repeat { display:flex;align-items:flex-end;gap:10px;padding:10px 0;border-bottom:1px solid var(--line); }.repeat>.field { flex:1; }.bands input { min-width:82px; }.bands select {min-width:100px;}.bands td { padding:6px; }
.tabs { display:flex;flex-wrap:wrap;gap:5px;border-bottom:1px solid var(--line);margin:0 0 18px; }.tab { padding:8px 13px;color:var(--muted);border-bottom:2px solid transparent; }.tab.selected { color:var(--accent);border-color:var(--accent);font-weight:650; }
.security-form { max-width:460px; }.report-dialog { width:min(445px,calc(100% - 30px));border:1px solid var(--line);border-radius:12px;padding:25px;color:var(--ink); }.report-dialog::backdrop { background:#1b203e70; }
.app-toast { position:fixed;right:20px;bottom:20px;max-width:90vw;background:#272c48;color:white;border-radius:8px;padding:12px 18px;z-index:10; }
.login-page { display:grid; place-items:center; min-height:100dvh; max-width:none; padding:22px; background:radial-gradient(ellipse at 12% 0%,#ebeafd,transparent 51%),radial-gradient(ellipse at 100% 100%,#e7eeef,transparent 50%),#f5f6fb; }
.login-wrap { width:min(390px,100%); }.login-wrap>.brand { justify-content:center; margin:0 0 12px; }.login-form { padding:32px; }.login-form h1 { font-size:25px; }.login-form .btn { width:100%;gap:7px; }.login-form .alert:empty { display:none; }
@media(max-width:1100px){.shell{grid-template-columns:188px minmax(0,1fr)}.sidebar{padding:0 9px}.quick-grid{grid-template-columns:repeat(2,1fr)}.panel{padding:17px}.metric{padding:13px;}}
@media(max-width:820px){.shell{display:block}.sidebar{display:none;position:fixed;top:57px;left:0;width:224px;height:calc(100dvh - 57px);box-shadow:5px 8px 16px #262b4415}.sidebar.open{display:flex}.btn.menu-toggle{display:inline-flex}.topbar{position:sticky;top:0;z-index:4;min-height:57px}.dashboard-grid{grid-template-columns:minmax(0,1.5fr) minmax(240px,1fr)}.summary-groups{grid-template-columns:1fr 1fr}.stats{gap:10px;}}
@media(max-width:650px){main{padding:22px 14px 40px}.stats,.quick-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-grid,.summary-groups,.form-grid{grid-template-columns:1fr;gap:0}.panel{padding:15px}.topbar{padding:8px 12px}.crumb,.account{gap:6px}.crumb>.ui-icon,.account>.avatar{display:none}.heading{gap:10px}.heading .actions{gap:7px}.repeat{flex-wrap:wrap}.repeat>.field{flex:1 1 105px}.chart-head select{min-width:92px}.login-form{padding:24px}.card-title{font-size:16px}.metric-foot{font-size:11px}.summary-groups .panel{margin-bottom:12px}}
.filters { display:grid;grid-template-columns:2fr repeat(3,minmax(0,1fr)) auto;gap:12px;align-items:end; }
.filters .actions { padding-bottom:2px; }
.detail-grid { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px; }
.detail-grid .panel { margin-bottom:0; }
.kv { display:grid;grid-template-columns:max-content 1fr;gap:8px 16px;margin:0; }
.kv dt { color:var(--muted);font-weight:400; }
.kv dd { margin:0;word-break:break-all; }
.badge.danger { background:#fde8e8;color:#b42318; }
.badge.warn { background:#fff4e0;color:#9a5b00; }
@media(max-width:1000px){.filters,.detail-grid{grid-template-columns:1fr}}
.tag-gap { margin-left:6px; }
.bands select { min-width:170px; } .bands input[name="store_sku"] { min-width:200px; }
.sms-code { font: 600 20px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .18em; color: #1f7a3d; }
form.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
form.toolbar input { max-width: 220px; }
/* business dashboards */
.dash-toolbar { display:flex; flex-wrap:wrap; align-items:flex-end; gap:14px; margin-bottom:18px; }
.dash-toolbar .form-label, .dash-toolbar label { margin:0; }
.dash-ranges { display:inline-flex; }
.dash-ranges .btn.active { background:var(--accent); border-color:var(--accent); color:#fff; }
.dash-section { margin-bottom:26px; }
.dash-section > .card { margin-top:14px; }
.dash-head { display:flex; flex-wrap:wrap; align-items:baseline; gap:10px; margin-bottom:12px; }
.dash-head h2 { margin:0; font-size:17px; }
.dash-metrics { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:14px; }
.dash-metric .stat-value { font-size:clamp(24px,2.4vw,31px); }
.dash-notes ul { margin:0; padding-left:20px; color:var(--muted); line-height:1.7; }
.quick-grid:has(> :nth-child(5)) { grid-template-columns:repeat(3,minmax(0,1fr)); }
@media (max-width: 720px) { .quick-grid:has(> :nth-child(5)) { grid-template-columns:1fr; } }
.panel > .quick-grid { margin-top:14px; }
.id-hint { color:var(--muted); font-size:12px; margin-left:2px; }
.search-row { display:flex; gap:8px; margin:0 0 14px; flex-wrap:wrap; }
.search-row input { flex:1; min-width:220px; max-width:460px; }
.clip { display:inline-block; max-width:280px; }
.rule-list { margin:0; padding-left:20px; color:#525d73; line-height:1.9; font-size:13px; }
.impact { margin:0; font-size:13px; line-height:1.7; color:#525d73; }
.danger-text { color:#c0392b; }
.share { display:flex; align-items:center; gap:8px; min-width:140px; }
.share-track { width:100px; height:8px; border-radius:4px; background:#edf0f5; display:inline-block; overflow:hidden; }
.share-bar { height:100%; border-radius:4px; background:var(--accent); display:block; }
.report-actions { align-self:flex-end; }
.search-row .field { margin:0; }
.ana-alert { border-color:#f3b4b4; }
.ana-alert .stat-value { color:#b42318; }
.ana-pct { display:inline-flex; align-items:center; gap:8px; min-width:120px; }
