:root{--bg:#f5f7f9;--panel:#fff;--ink:#17212b;--muted:#687580;--line:#e3e8ec;--accent:#176b5b;--accent-dark:#0f5447;--accent-soft:#e8f4f1;--positive:#13795b;--negative:#c33b36;--warning:#9a5b00;--blue:#3972d4;--sidebar:#14221f;--radius:12px;--shadow:0 1px 2px rgba(20,34,31,.04)}
*{box-sizing:border-box}html{font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;color:var(--ink);background:var(--bg);font-size:14px}body{margin:0;min-height:100vh}button,input,select{font:inherit}a{color:inherit;text-decoration:none}button{cursor:pointer}
.app-shell{padding-left:240px}.sidebar{position:fixed;inset:0 auto 0 0;width:240px;background:var(--sidebar);color:#dfe9e6;padding:22px 14px;display:flex;flex-direction:column;z-index:20}.brand{display:flex;align-items:center;gap:11px;padding:0 9px 25px}.brand-mark{display:grid;place-items:center;width:34px;height:34px;border-radius:10px;background:#d9fff4;color:#125849;font-size:18px;font-weight:800}.brand-mark.large{width:46px;height:46px;font-size:22px}.brand strong,.brand small,.identity strong,.identity small{display:block}.brand strong{font-size:15px;color:#fff}.brand small{font-size:11px;color:#90aaa3;margin-top:2px;letter-spacing:.04em}.sidebar nav{display:flex;flex-direction:column;gap:3px}.nav-item{display:flex;align-items:center;gap:11px;min-height:42px;border-radius:8px;padding:0 11px;color:#aebfba;font-weight:550;transition:background .12s,color .12s}.nav-item svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8}.nav-item:hover{background:rgba(255,255,255,.06);color:#fff}.nav-item.active{background:rgba(112,224,194,.13);color:#a7f3df}.sidebar-foot{margin-top:auto;border-top:1px solid rgba(255,255,255,.08);padding:16px 6px 0;display:flex;align-items:center;justify-content:space-between}.identity{display:flex;align-items:center;gap:9px}.identity strong{font-size:13px;color:#fff}.identity small{font-size:11px;color:#8fa29e;margin-top:2px}.avatar{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:#28453f;color:#a7f3df;font-weight:700}.icon-button{width:32px;height:32px;border:0;border-radius:7px;color:#9cb0aa;background:transparent}.icon-button:hover{background:rgba(255,255,255,.07);color:#fff}.mobile-menu{display:none}
.main{max-width:1180px;margin:0 auto;padding:34px 30px 60px}.main.wide{max-width:1460px}.page-head{display:flex;justify-content:space-between;align-items:flex-start;gap:24px;margin-bottom:22px}.page-head h1{margin:0;font-size:26px;line-height:1.25;letter-spacing:-.025em}.page-head p{margin:7px 0 0;color:var(--muted);line-height:1.55}.page-actions{display:flex;gap:10px;align-items:flex-end}.date-pill{padding:7px 11px;background:#fff;border:1px solid var(--line);border-radius:8px;font-weight:650;color:#42505b;white-space:nowrap}
.panel{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:21px;margin-bottom:18px}.panel-head{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:18px}.panel-head.inline{align-items:center}.panel-head.sub{margin-top:24px;padding-top:20px;border-top:1px solid var(--line)}.panel-head h2{font-size:15px;margin:0;letter-spacing:-.01em}.panel-head p{font-size:12px;margin:5px 0 0;color:var(--muted);line-height:1.5}.table-panel{padding:0;overflow:hidden}.table-panel .panel-head{padding:19px 20px 0}.two-column{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(340px,.95fr);gap:18px;align-items:start}.admin-grid{display:grid;grid-template-columns:minmax(0,2fr) minmax(300px,1fr);gap:18px;align-items:start}.side-form{position:sticky;top:24px}.settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.settings-grid .panel{margin:0}.full-span{grid-column:1/-1}
.kpi-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:18px}.kpi{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:18px 19px;box-shadow:var(--shadow);position:relative;overflow:hidden}.kpi:before{content:"";position:absolute;left:0;top:16px;bottom:16px;width:3px;background:#cbd4da;border-radius:0 3px 3px 0}.kpi.positive:before{background:var(--positive)}.kpi.negative:before{background:var(--negative)}.kpi span,.kpi small{display:block;color:var(--muted)}.kpi span{font-size:12px;font-weight:600}.kpi strong{display:block;margin:9px 0 5px;font-size:25px;letter-spacing:-.035em;font-variant-numeric:tabular-nums}.kpi small{font-size:11px}
.notice{display:flex;align-items:flex-start;gap:11px;padding:13px 14px;border:1px solid var(--line);border-radius:9px;margin-bottom:16px;background:#fff}.notice-dot{width:8px;height:8px;margin-top:5px;border-radius:50%;background:#789}.notice>div{flex:1}.notice strong{font-size:13px}.notice p{margin:3px 0 0;color:var(--muted);font-size:12px;line-height:1.5}.notice.success{border-color:#bce5d9;background:#f4fbf8}.notice.success .notice-dot{background:var(--positive)}.notice.warning{border-color:#eed7ad;background:#fffaf1}.notice.warning .notice-dot{background:#c87a00}.notice.critical{border-color:#f0c3c0;background:#fff7f6}.notice.critical .notice-dot{background:var(--negative)}.notice.info{border-color:#c9d8f2;background:#f5f8fe}.notice.info .notice-dot{background:var(--blue)}
.button{display:inline-flex;align-items:center;justify-content:center;border-radius:8px;min-height:36px;padding:0 14px;border:1px solid transparent;font-weight:650;font-size:13px;transition:background .12s,border-color .12s,transform .08s;white-space:nowrap}.button:active{transform:translateY(1px)}.button.primary{background:var(--accent);color:#fff}.button.primary:hover{background:var(--accent-dark)}.button.secondary{background:#fff;border-color:#cfd7dc;color:#27343d}.button.secondary:hover,.button.tertiary:hover{background:#f4f6f7}.button.tertiary{min-height:31px;padding:0 10px;background:transparent;border-color:var(--line);color:#40505b}.button.full{width:100%;min-height:42px}.text-button{border:0;background:transparent;color:var(--accent);font-weight:650}.stack-form{display:flex;flex-direction:column;gap:15px}.stack-form label,.row-form label,.fee-row label{display:flex;flex-direction:column;gap:6px}.stack-form label>span,.row-form label>span,.fee-row label>span{font-size:12px;font-weight:650;color:#42505b}.stack-form em{font-style:normal;font-weight:400;color:#8d989f}.field-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}input,select{width:100%;height:40px;padding:0 11px;border:1px solid #cfd7dc;border-radius:8px;background:#fff;color:var(--ink);outline:none;transition:border .12s,box-shadow .12s}input:focus,select:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(23,107,91,.12)}input::placeholder{color:#9ca7ad}.calc-preview{display:grid;grid-template-columns:1fr auto;align-items:center;background:#f4f8f7;border-radius:8px;padding:12px}.calc-preview span{font-size:12px;color:var(--muted)}.calc-preview strong{font-size:17px}.calc-preview small{grid-column:1/-1;margin-top:3px;color:#8a969c}.password-wrap{position:relative}.password-wrap input{padding-right:65px}.password-wrap button{position:absolute;right:7px;top:8px}
.cost-list{margin:0}.cost-list div{display:flex;justify-content:space-between;padding:12px 0;border-bottom:1px solid var(--line)}.cost-list dt{color:var(--muted)}.cost-list dd{margin:0;font-weight:650;font-variant-numeric:tabular-nums}.cost-list .total{border:0;padding-top:17px}.mini-list>div{display:flex;justify-content:space-between;align-items:center;padding:10px 0}.mini-list strong,.mini-list small,td strong,td small{display:block}.mini-list small,td small{color:var(--muted);font-size:11px;margin-top:3px}.muted{color:var(--muted)}
.table-scroll{overflow:auto}table{width:100%;border-collapse:collapse;min-width:700px}th{padding:10px 14px;text-align:left;background:#f7f9fa;border-bottom:1px solid var(--line);color:#63717b;font-size:11px;text-transform:none;letter-spacing:.02em;white-space:nowrap}td{padding:12px 14px;border-bottom:1px solid #edf0f2;font-size:12px;vertical-align:middle}tbody tr:last-child td{border-bottom:0}tbody tr:hover{background:#fafcfc}th.num,td.num{text-align:right;font-variant-numeric:tabular-nums}.table-empty{text-align:center;color:var(--muted);padding:50px}.profit{color:var(--positive);font-weight:700}.loss{color:var(--negative);font-weight:700}.table-link{font-weight:700;color:var(--accent)}code{font-family:"SFMono-Regular",Consolas,monospace;font-size:11px;background:#f2f5f5;padding:3px 6px;border-radius:5px;color:#40505b}.badge{display:inline-flex;align-items:center;min-height:22px;padding:0 8px;border-radius:999px;background:#edf1f2;color:#56636b;font-size:10px;font-weight:700}.badge.success{background:#e4f4ee;color:#14644f}.badge.warning{background:#fff0d7;color:#865100}.badge.critical{background:#fee9e7;color:#ad332f}.table-tools{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid var(--line)}.table-tools input{max-width:330px}.table-tools span{font-size:12px;color:var(--muted)}.inline-edit{display:grid;grid-template-columns:110px 100px 110px auto;gap:8px;align-items:center}.inline-edit input{height:34px}.row-form{display:grid;grid-template-columns:1.2fr .8fr 1fr auto;gap:10px;align-items:end}.fee-list{display:flex;flex-direction:column}.fee-row{display:grid;grid-template-columns:minmax(180px,1fr) 85px 85px auto;gap:10px;align-items:end;padding:12px 0;border-top:1px solid var(--line)}.fee-row:first-child{border-top:0}.fee-row>div strong,.fee-row>div small{display:block}.fee-row>div small{font-size:10px;color:var(--muted);margin-top:3px}.fee-row input{height:34px}.rate-chips{display:flex;flex-wrap:wrap;gap:7px;margin-top:15px}.rate-chips span{padding:6px 8px;border:1px solid var(--line);border-radius:6px;font-size:10px;color:#56636b}.rate-chips em{font-style:normal;color:#8b979e;margin-left:3px}
.date-filter{display:flex;align-items:flex-end;gap:8px}.date-filter label{display:flex;flex-direction:column;gap:4px}.date-filter label span{font-size:10px;color:var(--muted)}.date-filter input{height:36px;width:137px}.date-sep{height:36px;display:grid;place-items:center;color:#89949a}.legend{display:flex;gap:15px;font-size:11px;color:var(--muted)}.legend span:before{content:"";display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:5px}.legend .rev:before{background:var(--accent)}.legend .ad:before{background:#7f91a0}.legend .pro:before{background:#d39b3b}.chart-wrap{height:260px}.chart-wrap svg{width:100%;height:220px;overflow:visible}.line{fill:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}.line.revenue{stroke:var(--accent)}.line.spend{stroke:#7f91a0;stroke-width:2}.line.profit-line{stroke:#d39b3b;stroke-width:2}.axis{stroke:#e5eaed}.chart-labels{display:flex;justify-content:space-between;padding:0 10px;color:#89949a;font-size:10px}.chart-empty{height:220px;display:grid;place-items:center;color:var(--muted)}
.empty{text-align:center;padding:40px 15px}.empty-icon{font-size:28px;color:#a8b4ba}.empty h3{font-size:14px;margin:9px 0 4px}.empty p{color:var(--muted);font-size:12px;margin:0 auto 14px;max-width:330px;line-height:1.5}.toast{position:fixed;left:50%;bottom:24px;transform:translate(-50%,20px);opacity:0;pointer-events:none;background:#172521;color:#fff;padding:10px 14px;border-radius:8px;font-size:12px;box-shadow:0 8px 30px rgba(0,0,0,.2);transition:.18s;z-index:100}.toast.show{opacity:1;transform:translate(-50%,0)}
.auth-shell{background:radial-gradient(circle at 20% 10%,#e6f3ef 0,transparent 34%),#f5f7f7}.auth-main{min-height:100vh;display:grid;place-items:center;padding:24px}.login-card{width:100%;max-width:410px;background:#fff;border:1px solid var(--line);border-radius:16px;padding:30px;box-shadow:0 18px 50px rgba(31,52,47,.09)}.login-brand{display:flex;align-items:center;gap:12px}.login-brand strong,.login-brand span{display:block}.login-brand strong{font-size:16px}.login-brand div span{font-size:11px;color:var(--muted);margin-top:2px}.login-copy{margin:30px 0 22px}.login-copy h1{font-size:25px;margin:0}.login-copy p{margin:7px 0 0;color:var(--muted);line-height:1.5}.security-note{text-align:center;color:#7a878e;font-size:11px;margin:18px 0 0}.request-id{color:var(--muted);font-size:11px}
@media(max-width:980px){.app-shell{padding-left:0}.sidebar{transform:translateX(-100%);transition:transform .18s}.sidebar.open{transform:translateX(0)}.mobile-menu{display:block;position:fixed;right:14px;top:13px;z-index:19;width:40px;height:40px;border:1px solid var(--line);border-radius:9px;background:#fff;box-shadow:var(--shadow)}.main{padding:68px 16px 40px}.two-column,.admin-grid,.settings-grid{grid-template-columns:1fr}.side-form{position:static}.kpi-grid{grid-template-columns:1fr 1fr}.full-span{grid-column:auto}.page-head{flex-direction:column}.page-actions{width:100%;flex-wrap:wrap}.date-filter{flex-wrap:wrap}.fee-row{grid-template-columns:1fr 1fr}.fee-row>div{grid-column:1/-1}.inline-edit{grid-template-columns:1fr 1fr}.inline-edit .button{grid-column:1/-1}}
@media(max-width:580px){.kpi-grid{grid-template-columns:1fr}.field-row,.row-form{grid-template-columns:1fr}.date-filter label{flex:1}.date-filter input{width:100%}.date-sep{display:none}.date-filter .button{width:100%}.login-card{padding:24px}.page-head h1{font-size:23px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}

/* Interaction and accessibility hardening */
button:disabled{cursor:wait;opacity:.68}
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid rgba(57,114,212,.32);outline-offset:2px}
.skip-link{position:fixed;left:12px;top:12px;z-index:1000;transform:translateY(-160%);background:#fff;padding:10px 14px;border-radius:8px;box-shadow:0 4px 20px rgba(0,0,0,.18);font-weight:700}.skip-link:focus{transform:none}
.icon-button{width:auto;min-width:44px;padding:0 7px;font-size:11px}.sidebar-backdrop{display:none}
.offline-banner{position:sticky;top:12px;z-index:12;margin-bottom:16px;padding:11px 14px;border:1px solid #eed7ad;border-radius:9px;background:#fffaf1;color:#714800;font-weight:650;box-shadow:var(--shadow)}
@media(max-width:980px){.nav-open{overflow:hidden}.sidebar.open{box-shadow:10px 0 30px rgba(0,0,0,.18)}.sidebar-backdrop{position:fixed;inset:0;z-index:18;border:0;background:rgba(12,24,21,.35)}.sidebar-backdrop.show{display:block}.mobile-menu{left:14px;right:auto;width:42px;height:42px}}
