:root{
  --bg:#f6f7f9; --panel:#fff; --ink:#101828; --ink2:#344054; --muted:#667085; --faint:#98a2b3;
  --line:#eaecf0; --line2:#f2f4f7;
  --brand:#2f6bff; --brand-dark:#1d4ed8; --brand-soft:#eef4ff;
  --sidebar:#0b1220; --sidebar2:#111b2e;
  --green:#067647; --green-bg:#ecfdf3; --amber:#b54708; --amber-bg:#fffaeb;
  --red:#b42318; --red-bg:#fef3f2; --violet:#5925dc; --violet-bg:#f4f3ff;
  --radius:12px; --shadow:0 1px 2px rgba(16,24,40,.04),0 1px 3px rgba(16,24,40,.06);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--bg); color:var(--ink);
  font:13.5px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  -webkit-font-smoothing:antialiased;
}
a{color:inherit;text-decoration:none}
.app{display:flex;min-height:100vh}

/* ---------- sidebar ---------- */
.side{
  width:220px;flex:0 0 220px;background:linear-gradient(180deg,var(--sidebar),var(--sidebar2));
  color:#cbd5e1;display:flex;flex-direction:column;position:sticky;top:0;height:100vh;
}
.logo{display:flex;align-items:center;gap:10px;padding:20px 18px 16px}
.logo .mark{
  width:32px;height:32px;border-radius:9px;background:linear-gradient(135deg,#3b82f6,#22d3ee);
  display:flex;align-items:center;justify-content:center;color:#fff;font-weight:800;font-size:13px;letter-spacing:.5px;
}
.logo b{color:#fff;font-size:14px;letter-spacing:.3px;display:block;line-height:1.2}
.logo span{font-size:10.5px;color:#7c8aa5;letter-spacing:.12em}
.nav{padding:6px 10px;flex:1;overflow:auto}
.nav .sec{font-size:10px;color:#5f6f88;letter-spacing:.14em;padding:14px 10px 6px;text-transform:uppercase}
.nav a{
  display:flex;align-items:center;gap:10px;height:38px;padding:0 10px;border-radius:8px;
  color:#aebbd0;font-size:13px;margin-bottom:2px;position:relative;
}
.nav a svg{width:17px;height:17px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;opacity:.9}
.nav a:hover{background:rgba(255,255,255,.05);color:#e6edf8}
.nav a.on{background:rgba(47,107,255,.16);color:#fff}
.nav a.on:before{content:"";position:absolute;left:-10px;top:9px;bottom:9px;width:3px;border-radius:0 3px 3px 0;background:#4d84ff}
.nav .badge{margin-left:auto;background:#b42318;color:#fff;font-size:10px;line-height:16px;padding:0 6px;border-radius:9px}
.side-foot{padding:12px 16px 16px;border-top:1px solid rgba(255,255,255,.07);display:flex;align-items:center;gap:9px}
.avatar{width:30px;height:30px;border-radius:50%;background:#1d4ed8;color:#fff;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:600}
.side-foot .who{font-size:12px;color:#e2e8f0;line-height:1.25}
.side-foot .who span{display:block;font-size:10.5px;color:#7c8aa5}

/* ---------- main ---------- */
.main{flex:1;min-width:0;display:flex;flex-direction:column}
.topbar{
  height:64px;background:#fff;border-bottom:1px solid var(--line);
  display:flex;align-items:center;gap:16px;padding:0 24px;position:sticky;top:0;z-index:10;
}
.crumb{font-size:12px;color:var(--faint)}
.crumb b{color:var(--ink);font-weight:600;font-size:14px;display:block;line-height:1.2}
.topbar .spacer{flex:1}
.search{position:relative}
.search input{width:250px;height:34px;border:1px solid var(--line);border-radius:8px;padding:0 10px 0 32px;font-size:13px;background:#f9fafb;outline:none}
.search svg{position:absolute;left:10px;top:9px;width:15px;height:15px;stroke:#98a2b3;fill:none;stroke-width:1.8}
.icon-btn{width:34px;height:34px;border:1px solid var(--line);border-radius:8px;background:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;position:relative}
.icon-btn svg{width:16px;height:16px;stroke:#475467;fill:none;stroke-width:1.8}
.icon-btn .dot{position:absolute;top:7px;right:8px;width:6px;height:6px;border-radius:50%;background:#f04438;border:1.5px solid #fff}
.content{padding:20px 24px 48px;max-width:1560px;width:100%;margin:0 auto}

/* ---------- generic ---------- */
.row{display:flex;align-items:center;gap:10px}
.between{display:flex;align-items:center;justify-content:space-between;gap:12px}
.page-title{font-size:19px;font-weight:650;letter-spacing:-.01em;margin:0}
.page-sub{font-size:12px;color:var(--muted);margin-top:3px}
.btn{
  height:34px;padding:0 13px;border-radius:8px;border:1px solid transparent;background:var(--brand);color:#fff;
  font-size:13px;font-weight:550;cursor:pointer;display:inline-flex;align-items:center;gap:6px;white-space:nowrap;
}
.btn:hover{background:var(--brand-dark)}
.btn.ghost{background:#fff;border-color:#d0d5dd;color:var(--ink2)}
.btn.ghost:hover{background:#f9fafb}
.btn.sm{height:29px;padding:0 10px;font-size:12px;border-radius:7px}
.btn.danger{background:#fff;border-color:#fda29b;color:var(--red)}
.inp{height:34px;border:1px solid #d0d5dd;border-radius:8px;padding:0 10px;font-size:13px;background:#fff;color:var(--ink);outline:none}
.inp:focus{border-color:#84adff;box-shadow:0 0 0 3px rgba(47,107,255,.12)}
.seg{display:inline-flex;background:#f2f4f7;border-radius:8px;padding:3px}
.seg button{height:28px;padding:0 12px;border:0;background:transparent;border-radius:6px;font-size:12px;color:var(--muted);cursor:pointer}
.seg button.on{background:#fff;color:var(--ink);font-weight:600;box-shadow:0 1px 2px rgba(16,24,40,.08)}

.card{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}
.card-h{padding:14px 16px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:10px}
.card-h h3{margin:0;font-size:14px;font-weight:650}
.card-b{padding:16px}

.kpis{display:grid;grid-template-columns:repeat(5,1fr);gap:12px;margin-bottom:14px}
.kpi{padding:14px 16px;position:relative;overflow:hidden}
.kpi .k{font-size:11.5px;color:var(--muted)}
.kpi .v{font-size:24px;font-weight:680;letter-spacing:-.02em;margin-top:2px;font-variant-numeric:tabular-nums}
.kpi .d{font-size:11px;color:var(--muted);margin-top:2px}
.kpi .d em{font-style:normal;font-weight:600}
.up{color:var(--green)} .down{color:var(--red)}
.kpi .ico{position:absolute;right:12px;top:12px;width:28px;height:28px;border-radius:8px;background:var(--brand-soft);display:flex;align-items:center;justify-content:center}
.kpi .ico svg{width:15px;height:15px;stroke:var(--brand);fill:none;stroke-width:1.8}
.kpi.warn .ico{background:var(--amber-bg)} .kpi.warn .ico svg{stroke:var(--amber)}

.notice{
  display:flex;align-items:center;gap:10px;background:var(--amber-bg);border:1px solid #fedf89;color:#93370d;
  border-radius:10px;padding:10px 14px;font-size:12.5px;margin-bottom:14px;
}
.notice svg{width:16px;height:16px;stroke:#b54708;fill:none;stroke-width:1.9;flex:0 0 auto}
.notice b{font-weight:650}
.notice a{margin-left:auto;font-weight:600;color:#93370d;text-decoration:underline;text-underline-offset:2px}

.toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:12px 14px;border-bottom:1px solid var(--line)}
.toolbar .spacer{flex:1}
.toolbar .lab{font-size:11.5px;color:var(--muted);margin:0 2px 0 6px}

/* ---------- table ---------- */
.tbl-wrap{overflow:auto}
table{width:100%;border-collapse:separate;border-spacing:0}
thead th{
  position:sticky;top:0;background:#f9fafb;color:var(--muted);font-size:11px;font-weight:600;
  letter-spacing:.03em;text-align:left;padding:9px 10px;border-bottom:1px solid var(--line);white-space:nowrap;z-index:2;
}
tbody td{padding:9px 10px;border-bottom:1px solid var(--line2);vertical-align:middle}
tbody tr:hover{background:#f9fafb}
tbody tr.sel{background:#f0f5ff;box-shadow:inset 3px 0 0 var(--brand)}
tbody tr:last-child td{border-bottom:0}
.num{text-align:right;font-variant-numeric:tabular-nums}
.asin{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11.5px;font-weight:600;letter-spacing:-.01em}
.t-title{font-size:12px;color:var(--ink2);max-width:250px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:1px}
.mkt{font-size:10.5px;color:var(--faint)}

.owner{display:flex;align-items:center;gap:6px;font-size:12px;white-space:nowrap;flex-wrap:nowrap}
.owner .av{width:22px;height:22px;border-radius:50%;background:#eef2f6;color:#475467;font-size:10px;display:flex;align-items:center;justify-content:center;font-weight:600}
.owner.none .av{background:var(--amber-bg);color:var(--amber)}
.muted{color:var(--muted)} .faint{color:var(--faint)}
.small{font-size:11.5px}

.pill{display:inline-flex;align-items:center;gap:4px;padding:1px 8px;border-radius:999px;font-size:11px;font-weight:550;line-height:18px;white-space:nowrap}
.pill.gray{background:#f2f4f7;color:#475467}
.pill.blue{background:var(--brand-soft);color:var(--brand-dark)}
.pill.green{background:var(--green-bg);color:var(--green)}
.pill.amber{background:var(--amber-bg);color:var(--amber)}
.pill.red{background:var(--red-bg);color:var(--red)}
.pill.violet{background:var(--violet-bg);color:var(--violet)}
.delta{font-size:11.5px;font-weight:600;font-variant-numeric:tabular-nums}

.mini{display:flex;align-items:flex-end;gap:3px;height:24px;width:64px}
.mini i{width:7px;border-radius:2px 2px 0 0;background:#c7d7fe;display:block}
.mini i:last-child{background:var(--brand)}
.spark{height:24px;width:70px}

/* ---------- split / detail ---------- */
.split{display:grid;grid-template-columns:minmax(0,1fr) 396px;gap:16px;align-items:start}
.detail{position:sticky;top:84px}
.detail-h{padding:16px;border-bottom:1px solid var(--line)}
.detail-h .brandline{display:flex;align-items:center;gap:8px;font-size:11px;color:var(--muted);letter-spacing:.04em}
.detail-h h2{font-size:14px;line-height:1.45;margin:6px 0 8px;font-weight:650}
.tiles{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;padding:14px 16px;border-bottom:1px solid var(--line)}
.tile{background:#f9fafb;border:1px solid var(--line2);border-radius:9px;padding:9px 10px}
.tile .k{font-size:10.5px;color:var(--muted)}
.tile .v{font-size:16px;font-weight:670;margin-top:1px;font-variant-numeric:tabular-nums}
.tile .s{font-size:10px;color:var(--faint)}

.field{margin-bottom:12px}
.field label{display:block;font-size:11.5px;color:var(--muted);margin-bottom:5px}
.field .hint{font-size:10.5px;color:var(--faint);margin-top:3px}
.weeks{display:grid;grid-template-columns:repeat(4,1fr);gap:7px}
.week{background:#f9fafb;border:1px solid var(--line);border-radius:9px;padding:8px}
.week .wl{font-size:10.5px;color:var(--muted);display:flex;justify-content:space-between}
.week input{width:100%;border:0;background:transparent;font-size:16px;font-weight:650;color:var(--ink);outline:none;padding:3px 0 0;font-variant-numeric:tabular-nums}
.week .wd{font-size:9.5px;color:var(--faint)}
.total-line{display:flex;align-items:center;justify-content:space-between;background:var(--brand-soft);border:1px solid #d1e0ff;border-radius:9px;padding:9px 12px;margin:12px 0}
.total-line .k{font-size:11.5px;color:var(--brand-dark)}
.total-line b{font-size:18px;color:var(--brand-dark);font-variant-numeric:tabular-nums}
.detail-f{padding:12px 16px;border-top:1px solid var(--line);display:flex;gap:8px}
.detail-f .btn{flex:1;justify-content:center}

/* chart */
.chart{width:100%;height:120px;display:block}
.legend{display:flex;gap:14px;font-size:10.5px;color:var(--muted);margin-top:6px}
.legend i{width:8px;height:8px;border-radius:2px;display:inline-block;margin-right:4px}

/* alerts */
.alert{display:flex;gap:9px;padding:10px 0;border-bottom:1px solid var(--line2);font-size:12px}
.alert:last-child{border-bottom:0}
.alert .ai{width:26px;height:26px;border-radius:7px;background:var(--red-bg);display:flex;align-items:center;justify-content:center;flex:0 0 auto}
.alert .ai svg{width:14px;height:14px;stroke:var(--red);fill:none;stroke-width:1.9}
.alert .at{font-weight:600;color:var(--ink)}
.alert .am{color:var(--muted);font-size:11px;margin-top:1px}
.alert .aa{margin-left:auto;align-self:center}

/* login */
.login{min-height:100vh;display:grid;grid-template-columns:1.05fr .95fr;background:#fff}
.login-left{background:radial-gradient(120% 120% at 10% 0%,#1d4ed8 0%,#0b1220 55%,#070c16 100%);color:#fff;padding:56px 60px;display:flex;flex-direction:column;position:relative;overflow:hidden}
.login-left:after{content:"";position:absolute;right:-120px;bottom:-160px;width:420px;height:420px;border-radius:50%;background:radial-gradient(circle,rgba(47,107,255,.35),transparent 65%)}
.login-left .brand{display:flex;align-items:center;gap:11px;font-weight:700;font-size:15px}
.login-left .brand .mark{width:34px;height:34px;border-radius:9px;background:linear-gradient(135deg,#3b82f6,#22d3ee);display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:800}
.login-left .hero{margin:auto 0}
.login-left h1{font-size:34px;line-height:1.28;letter-spacing:-.02em;margin:0 0 14px;font-weight:680;max-width:520px}
.login-left p{color:#9fb0cc;font-size:14px;max-width:460px;margin:0 0 28px}
.feats{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:40px}
.feat{border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.06);color:#dbe6f7;font-size:12px;padding:6px 11px;border-radius:999px}
.login-left .foot{font-size:11px;color:#5f7191}
.login-right{display:flex;align-items:center;justify-content:center;padding:40px;background:#fff}
.login-card{width:352px}
.login-card h2{font-size:21px;margin:0 0 4px;letter-spacing:-.01em}
.login-card .sub{color:var(--muted);font-size:12.5px;margin:0 0 26px}
.login-card label{display:block;font-size:12px;color:var(--ink2);margin:14px 0 6px;font-weight:550}
.login-card .inp{width:100%;height:40px;border-radius:9px}
.login-card .btn{width:100%;height:40px;justify-content:center;margin-top:20px;border-radius:9px}
.login-card .tip{display:flex;gap:8px;background:#f9fafb;border:1px solid var(--line);border-radius:9px;padding:10px 12px;font-size:11.5px;color:var(--muted);margin-top:22px;line-height:1.5}
.login-card .tip svg{width:15px;height:15px;stroke:#667085;fill:none;stroke-width:1.8;flex:0 0 auto;margin-top:1px}

/* admin */
.syncbar{display:flex;align-items:center;gap:12px;background:var(--green-bg);border:1px solid #abefc6;color:#067647;border-radius:10px;padding:10px 14px;font-size:12.5px;margin-bottom:14px}
.syncbar b{font-weight:650}
.syncbar .spacer{flex:1}
.syncbar .time{color:#3f8f6b;font-size:11.5px}
.rules{display:grid;gap:10px}
.rule{display:flex;gap:10px;padding:11px;border:1px solid var(--line);border-radius:10px;background:#fcfcfd}
.rule .lv{width:26px;height:26px;border-radius:8px;background:#eef4ff;color:#1d4ed8;font-size:11px;font-weight:700;display:flex;align-items:center;justify-content:center;flex:0 0 auto}
.rule .rt{font-size:12.5px;font-weight:600}
.rule .rd{font-size:11px;color:var(--muted);margin-top:1px}

/* ---------- channel listing ---------- */
.tabs{display:flex;gap:2px;border-bottom:1px solid var(--line);padding:0 12px;overflow:auto}
.tab{padding:11px 13px;font-size:12.5px;color:var(--muted);border-bottom:2px solid transparent;cursor:pointer;white-space:nowrap;display:flex;align-items:center;gap:6px}
.tab b{font-weight:600;font-size:11px;background:#f2f4f7;color:#475467;border-radius:9px;padding:0 6px;line-height:16px}
.tab.on{color:var(--brand-dark);border-color:var(--brand);font-weight:600}
.tab.on b{background:var(--brand-soft);color:var(--brand-dark)}
.plat{display:inline-flex;align-items:center;gap:4px;font-size:10.5px;font-weight:600;padding:1px 7px;border-radius:5px;white-space:nowrap}
.plat.amz{background:#fff7ed;color:#c2410c}
.plat.wmt{background:#eff8ff;color:#175cd3}
.plat.tts{background:#f2f4f7;color:#101828}
.plat.ebay{background:#fef3f2;color:#b42318}
.plat.shop{background:#ecfdf3;color:#067647}
.cc{font-size:9.5px;font-weight:600;color:#475467;background:#f2f4f7;border-radius:4px;padding:0 4px;line-height:15px}
.thumb{width:38px;height:38px;border-radius:7px;background:#f2f4f7;border:1px solid var(--line);display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:700;color:#98a2b3;flex:0 0 auto}
.ops{display:flex;gap:4px}
.op{font-size:11px;padding:3px 7px;border:1px solid #d0d5dd;border-radius:6px;background:#fff;color:#344054;white-space:nowrap;cursor:pointer}
.op:hover{border-color:#84adff;color:#1d4ed8;background:#f5f8ff}
.op.dis{color:#98a2b3;border-color:#eaecf0;cursor:default}
.op.dis:hover{background:#fff;color:#98a2b3;border-color:#eaecf0}
.bulkbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:10px 14px;border-bottom:1px solid var(--line);background:#fcfcfd}
.bulkbar .sep{width:1px;height:18px;background:var(--line)}
.link{font-size:10.5px;color:var(--brand);font-weight:550}
.pair{display:inline-flex;align-items:center;gap:3px;font-size:9.5px;color:#067647;background:#ecfdf3;border-radius:4px;padding:0 4px;line-height:15px}
