:root{
  --bg:#f5f6f8; --surface:#ffffff; --surface-2:#eef0f4; --line:#dfe2e8; --line-2:#eceef2;
  --text:#1b1e26; --text-2:#4b5060; --text-3:#7a8090; --accent:#4650d2; --accent-soft:#eceeff; --accent-text:#2f38a6;
  --ok:#1d8a4b; --ok-soft:#e5f5eb; --warn:#b3580a; --warn-soft:#fff2df; --bad:#b52a2a; --bad-soft:#fde6e6;
  --sidebar:#1b1e26; --sidebar-text:#c6c9d3; --sidebar-on:#2b2f3b; --phone:#111318;
  --mono:'IBM Plex Mono',ui-monospace,SFMono-Regular,Menlo,monospace; --sans:'IBM Plex Sans','Segoe UI',Helvetica,Arial,sans-serif;
}
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]){
  --bg:#15171d; --surface:#1d2028; --surface-2:#262a34; --line:#343945; --line-2:#2c303a;
  --text:#e8e9ee; --text-2:#b7bbc7; --text-3:#858a99; --accent:#8b93ff; --accent-soft:#2a2e4a; --accent-text:#c3c7ff;
  --ok:#5ccf85; --ok-soft:#1c3327; --warn:#f0a44a; --warn-soft:#3a2a15; --bad:#f07b7b; --bad-soft:#3d1f1f;
  --sidebar:#101217; --sidebar-text:#aeb2bf; --sidebar-on:#22252e; --phone:#0b0c10;
}}
:root[data-theme="dark"]{
  --bg:#15171d; --surface:#1d2028; --surface-2:#262a34; --line:#343945; --line-2:#2c303a;
  --text:#e8e9ee; --text-2:#b7bbc7; --text-3:#858a99; --accent:#8b93ff; --accent-soft:#2a2e4a; --accent-text:#c3c7ff;
  --ok:#5ccf85; --ok-soft:#1c3327; --warn:#f0a44a; --warn-soft:#3a2a15; --bad:#f07b7b; --bad-soft:#3d1f1f;
  --sidebar:#101217; --sidebar-text:#aeb2bf; --sidebar-on:#22252e; --phone:#0b0c10;
}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--text);font-family:var(--sans);font-size:13px;line-height:1.45}
a{color:var(--accent-text)}
button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}
input,select,textarea{font:inherit;color:var(--text);background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:8px 10px;width:100%}
input:focus,select:focus,textarea:focus,button:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
.topbar{height:52px;display:flex;align-items:center;gap:16px;padding:0 20px;background:var(--surface);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:5}
.brand{display:flex;align-items:center;gap:10px;font-weight:600;font-size:15px}
.brand i{width:26px;height:26px;border-radius:7px;background:var(--accent);color:#fff;display:inline-flex;align-items:center;justify-content:center;font-style:normal;font-size:13px}
.roles{display:flex;gap:4px;background:var(--surface-2);padding:3px;border-radius:9px}
.roles button{padding:6px 14px;border-radius:7px;font-weight:500;color:var(--text-2)}
.roles button.on{background:var(--surface);color:var(--text);box-shadow:0 1px 2px rgba(0,0,0,.08)}
.topbar .hint{color:var(--text-3);margin-left:auto;font-size:12px}
.app{display:flex;min-height:calc(100vh - 52px)}
.side{width:216px;flex-shrink:0;background:var(--sidebar);color:var(--sidebar-text);padding:18px 10px;display:flex;flex-direction:column;gap:2px}
.side .ctx{padding:0 12px 12px;font-size:11px;letter-spacing:.05em;text-transform:uppercase;color:#8a8f9c}
.side button{display:flex;align-items:center;gap:10px;height:36px;padding:0 12px;border-radius:8px;color:var(--sidebar-text);text-align:left;width:100%}
.side button.on{background:var(--sidebar-on);color:#fff;font-weight:500}
.side button svg{width:16px;height:16px;flex-shrink:0}
.side .foot{margin-top:auto;padding:10px 12px;font-size:12px;color:#8a8f9c}
.main{flex-grow:1;min-width:0;display:flex;flex-direction:column}
.head{height:54px;display:flex;align-items:center;justify-content:space-between;padding:0 26px;background:var(--surface);border-bottom:1px solid var(--line)}
.head h1{font-size:16px;font-weight:600;margin:0}
.head .acts{display:flex;gap:8px;align-items:center}
.content{padding:22px 26px;display:flex;flex-direction:column;gap:18px}
.card{background:var(--surface);border:1px solid var(--line);border-radius:10px}
.card .ch{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid var(--line-2);font-weight:600}
.card .cb{padding:14px 16px}
.kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.kpi{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:14px 16px;display:flex;flex-direction:column;gap:6px}
.kpi .v{font-size:26px;font-weight:600;line-height:1.1;font-variant-numeric:tabular-nums}
.lbl{font-size:11px;font-weight:600;color:var(--text-3);text-transform:uppercase;letter-spacing:.05em}
.pill{display:inline-flex;align-items:center;height:22px;padding:0 8px;border-radius:6px;font-size:11px;font-weight:600;white-space:nowrap}
.ok{background:var(--ok-soft);color:var(--ok)} .warn{background:var(--warn-soft);color:var(--warn)} .bad{background:var(--bad-soft);color:var(--bad)} .neu{background:var(--surface-2);color:var(--text-2)} .ind{background:var(--accent-soft);color:var(--accent-text)}
.btn{display:inline-flex;align-items:center;justify-content:center;height:34px;padding:0 14px;border-radius:8px;font-weight:600;font-size:13px;gap:6px;white-space:nowrap;transition:filter .15s ease,background .15s ease,transform .05s ease}
.btn.primary{background:var(--accent);color:#fff}.btn.ghost{background:var(--surface);border:1px solid var(--line)}.btn.sm{height:28px;padding:0 10px;font-size:12px}.btn:disabled{opacity:.45;cursor:not-allowed}
.btn.primary:hover:not(:disabled){filter:brightness(1.08)}.btn.ghost:hover:not(:disabled){background:var(--surface-2)}.btn:active:not(:disabled){transform:translateY(1px)}
a{transition:color .15s ease}
.auth-links a{color:var(--accent-text);text-decoration:none;font-weight:500}.auth-links a:hover{text-decoration:underline}
table{width:100%;border-collapse:collapse}
th{text-align:left;font-size:11px;font-weight:600;color:var(--text-3);text-transform:uppercase;letter-spacing:.05em;padding:10px 12px;border-bottom:1px solid var(--line-2);background:var(--surface-2)}
td{padding:10px 12px;border-bottom:1px solid var(--line-2);vertical-align:middle}
tr.row{cursor:pointer}tr.row:hover td{background:var(--surface-2)}tr.sel td{background:var(--accent-soft)}
.tw{overflow-x:auto}
.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.field{display:flex;flex-direction:column;gap:5px}
.split{display:flex;gap:18px;align-items:flex-start}.split>.grow{flex-grow:1;min-width:0}
.list{display:flex;flex-direction:column}.list>div{display:flex;align-items:center;gap:10px;padding:10px 14px;border-bottom:1px solid var(--line-2)}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{display:inline-flex;align-items:center;height:36px;padding:0 14px;border-radius:9px;border:1px solid var(--line);background:var(--surface);font-size:14px;transition:border-color .15s ease,background .15s ease}
.chip:hover{border-color:var(--accent)}
.chip.on{border-color:var(--accent);background:var(--accent-soft);color:var(--accent-text);font-weight:500}
.stepper{display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.stepper div{display:flex;align-items:center;gap:7px;font-size:12px;color:var(--text-3)}
.stepper i{width:22px;height:22px;border-radius:11px;display:inline-flex;align-items:center;justify-content:center;font-size:11px;font-weight:600;font-style:normal;background:var(--surface-2);color:var(--text-3)}
.stepper .done i{background:var(--ok);color:#fff}.stepper .cur{color:var(--text);font-weight:600}.stepper .cur i{background:var(--accent);color:#fff}
.mono{font-family:var(--mono);font-size:12px}
.bar{height:6px;background:var(--surface-2);border-radius:3px;overflow:hidden}.bar i{display:block;height:100%;background:var(--accent);transition:width .4s}
.toast{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);background:var(--text);color:var(--bg);padding:10px 16px;border-radius:8px;font-weight:500;opacity:0;transition:opacity .2s;pointer-events:none;z-index:9}.toast.show{opacity:1}
.muted{color:var(--text-3)}.small{font-size:12px}
.draft{border:1px solid var(--line);border-radius:10px;padding:12px;display:flex;flex-direction:column;gap:6px;cursor:pointer;background:var(--surface)}
.draft.on{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}
.draft p{margin:0;white-space:pre-line;font-size:14px;line-height:1.5}
.trace{font-size:11px;color:var(--text-3);font-family:var(--mono)}
/* phone */
.phone-wrap{display:flex;gap:28px;justify-content:center;align-items:flex-start;padding:26px}
.phone{width:390px;height:844px;border-radius:38px;background:var(--phone);padding:12px;box-shadow:0 20px 50px rgba(0,0,0,.25);flex-shrink:0}
.screen{width:100%;height:100%;border-radius:28px;background:var(--bg);overflow:hidden;display:flex;flex-direction:column}
.ptop{padding:52px 20px 12px;background:var(--surface);border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center}
.pprog{display:flex;gap:4px;padding:10px 20px 0}.pprog i{flex-grow:1;height:3px;border-radius:2px;background:var(--line)}.pprog i.on{background:var(--accent)}
.pbody{flex-grow:1;overflow:auto;padding:18px 20px;display:flex;flex-direction:column;gap:14px}
.pbtn{display:flex;align-items:center;justify-content:center;height:48px;border-radius:10px;font-weight:600;font-size:15px;width:100%}
.pbtn.primary{background:var(--accent);color:#fff}.pbtn.dark{background:var(--text);color:var(--bg)}.pbtn.ghost{background:var(--surface);border:1px solid var(--line)}
.pcard{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:16px;display:flex;flex-direction:column;gap:8px}
.h2{font-size:22px;font-weight:600;line-height:1.25;text-wrap:balance}
.side-note{width:340px;display:flex;flex-direction:column;gap:12px}
.pf{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.pf button{height:60px;border-radius:12px;border:1px solid var(--line);background:var(--surface);display:flex;align-items:center;gap:10px;padding:0 12px;font-size:14px;font-weight:500;text-align:left}
.pf button.on{border-color:var(--accent);background:var(--accent-soft)}
.pf button i{width:26px;height:26px;border-radius:7px;flex-shrink:0}
.qr{display:grid;grid-template-columns:repeat(21,1fr);width:126px;height:126px;background:#fff;padding:6px;border:1px solid var(--line)}
.qr b{background:#111}
@media (prefers-reduced-motion: reduce){.bar i{transition:none}.toast{transition:none}}
/* auth */
.auth-wrap{display:flex;min-height:100vh;width:100%}
.auth-brand{flex:1.1;background:linear-gradient(150deg,var(--accent) 0%,#2f2f9e 100%);color:#fff;display:flex;flex-direction:column;justify-content:center;padding:60px 64px;gap:28px;position:relative;overflow:hidden}
.auth-brand::before{content:'';position:absolute;width:420px;height:420px;border-radius:50%;background:rgba(255,255,255,.07);top:-140px;right:-140px}
.auth-brand::after{content:'';position:absolute;width:320px;height:320px;border-radius:50%;background:rgba(255,255,255,.06);bottom:-120px;left:-80px}
.auth-brand>*{position:relative}
.auth-mark{width:52px;height:52px;border-radius:14px;background:rgba(255,255,255,.16);display:flex;align-items:center;justify-content:center;font-weight:700;font-size:24px}
.auth-brand h1{font-size:34px;font-weight:600;margin:22px 0 10px;line-height:1.2;letter-spacing:-.01em}
.auth-brand p.tag{font-size:15px;opacity:.82;max-width:360px;line-height:1.6;margin:0 0 30px}
.auth-features{display:flex;flex-direction:column;gap:16px}
.auth-features div{display:flex;align-items:center;gap:14px;font-size:14px;opacity:.95}
.auth-features i{width:34px;height:34px;border-radius:10px;background:rgba(255,255,255,.14);display:flex;align-items:center;justify-content:center;flex-shrink:0}
.auth-features i svg{width:17px;height:17px}
.auth-form-side{flex:1;display:flex;align-items:center;justify-content:center;padding:40px 24px;background:var(--bg)}
.auth-card{width:100%;max-width:360px}
.auth-card .eyebrow{color:var(--accent-text);font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.06em;margin-bottom:10px}
.auth-card h2{font-size:25px;margin:0 0 6px;font-weight:600}
.auth-card .sub{color:var(--text-3);font-size:13px;margin-bottom:26px}
.auth-box{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:26px;box-shadow:0 8px 30px rgba(20,20,50,.06);display:flex;flex-direction:column;gap:14px}
.auth-box input{height:44px;font-size:14px}
.auth-box .btn.primary{height:44px;width:100%;font-size:14px;margin-top:4px}
.auth-error{background:var(--bad-soft);color:var(--bad);border-radius:8px;padding:8px 12px;font-size:12.5px}
.auth-links{display:flex;flex-direction:column;gap:10px;align-items:center;margin-top:20px;font-size:13px}
.auth-mobile-strip{display:none}
@media (max-width: 860px){
  .auth-brand{display:none}
  .auth-form-side{padding:32px 20px}
  .auth-mobile-strip{display:flex;align-items:center;gap:12px;margin-bottom:24px}
  .auth-mobile-strip .auth-mark{width:40px;height:40px;font-size:19px;background:var(--accent);color:#fff;border-radius:11px}
  .auth-mobile-strip span{font-weight:600;font-size:16px}
}
