*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;background:#0d1117;color:#e6edf3;overflow:hidden}
::-webkit-scrollbar{width:0;height:0;display:none}
*{scrollbar-width:none;-ms-overflow-style:none}
a{color:inherit;text-decoration:none}
button{font:inherit;cursor:pointer;border:none;background:none;color:inherit}
input,textarea,select{font:inherit;color:inherit;background:#161b22;border:1px solid #30363d;border-radius:6px;padding:10px 12px;outline:none;width:100%}
input:focus,textarea:focus,select:focus{border-color:#25d366}
textarea{resize:vertical;min-height:80px;font-family:inherit}
label{display:block;margin-bottom:6px;font-size:13px;color:#8b949e}
.field{margin-bottom:14px}
.btn{background:#25d366;color:#0d1117;padding:10px 16px;border-radius:6px;font-weight:600;display:inline-flex;align-items:center;gap:8px;transition:background .15s}
.btn:hover{background:#1ea855}
.btn.secondary{background:#21262d;color:#e6edf3}
.btn.secondary:hover{background:#30363d}
.btn.danger{background:#da3633;color:#fff}
.btn.danger:hover{background:#b62b27}
.btn.small{padding:6px 10px;font-size:13px}
.row{display:flex;gap:12px}
.row>*{flex:1}

/* Login */
.auth-wrap{display:flex;align-items:center;justify-content:center;height:100vh;background:#0d1117}
.auth-card{background:#161b22;border:1px solid #30363d;border-radius:10px;padding:32px;width:360px}
.auth-card h1{font-size:22px;margin-bottom:6px}
.auth-card p{color:#8b949e;margin-bottom:22px;font-size:14px}
.auth-tabs{display:flex;gap:8px;margin-bottom:18px}
.auth-tabs button{flex:1;padding:8px;border-radius:6px;background:#0d1117;color:#8b949e;border:1px solid #30363d}
.auth-tabs button.active{background:#25d366;color:#0d1117;border-color:#25d366}

/* Layout */
.shell{display:grid;grid-template-columns:230px 1fr;height:100vh}
.sidebar{background:#010409;border-right:1px solid #21262d;padding:18px 0;display:flex;flex-direction:column}
.brand{padding:0 20px 20px;display:flex;align-items:center;gap:10px;border-bottom:1px solid #21262d;margin-bottom:14px}
.brand-logo{width:34px;height:34px;border-radius:8px;background:#25d366;color:#0d1117;display:flex;align-items:center;justify-content:center;font-weight:700}
.brand-name{font-weight:700;font-size:16px}
.nav{flex:1;padding:0 10px;overflow:hidden}
.nav a{display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:6px;color:#8b949e;font-size:14px;margin-bottom:2px}
.nav a:hover{background:#161b22;color:#e6edf3}
.nav a.active{background:#161b22;color:#25d366}
.nav .ic{width:18px;height:18px;display:inline-block;flex-shrink:0}
.user-box{padding:14px 16px;border-top:1px solid #21262d;font-size:13px;color:#8b949e}
.user-box .name{color:#e6edf3;font-weight:600;margin-bottom:2px}
.user-box .plan{display:inline-block;padding:2px 8px;border-radius:10px;background:#21262d;font-size:11px;margin-top:6px}

.main{overflow:auto;padding:24px 30px}
.page-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:22px}
.page-header h1{font-size:22px}
.page-header p{color:#8b949e;font-size:13px;margin-top:2px}

/* Cards */
.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:14px;margin-bottom:22px}
.card{background:#161b22;border:1px solid #21262d;border-radius:8px;padding:18px}
.card .label{color:#8b949e;font-size:12px;text-transform:uppercase;letter-spacing:.5px;margin-bottom:8px}
.card .value{font-size:26px;font-weight:700}
.card .sub{color:#8b949e;font-size:12px;margin-top:4px}

.panel{background:#161b22;border:1px solid #21262d;border-radius:8px;padding:20px;margin-bottom:18px}
.panel h2{font-size:16px;margin-bottom:14px}
.panel-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}

table{width:100%;border-collapse:collapse;font-size:14px}
table th,table td{text-align:left;padding:10px 12px;border-bottom:1px solid #21262d}
table th{color:#8b949e;font-weight:500;font-size:12px;text-transform:uppercase}
table tr:last-child td{border-bottom:none}

.status{display:inline-block;padding:3px 10px;border-radius:10px;font-size:11px;font-weight:600}
.status.connected{background:rgba(37,211,102,.15);color:#25d366}
.status.disconnected{background:rgba(218,54,51,.15);color:#da3633}
.status.qr,.status.connecting,.status.pending,.status.running{background:rgba(210,153,34,.15);color:#d29922}
.status.done{background:rgba(37,211,102,.15);color:#25d366}
.status.canceled,.status.error,.status.failed{background:rgba(218,54,51,.15);color:#da3633}

.modal{position:fixed;inset:0;background:rgba(0,0,0,.6);display:flex;align-items:center;justify-content:center;z-index:50}
.modal-card{background:#161b22;border:1px solid #30363d;border-radius:10px;padding:24px;width:480px;max-width:92vw;max-height:90vh;overflow:auto}
.modal-card h3{font-size:17px;margin-bottom:16px}
.modal-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:16px}

.qr-wrap{display:flex;flex-direction:column;align-items:center;padding:18px}
.qr-wrap img{width:260px;height:260px;background:#fff;padding:8px;border-radius:8px}
.qr-wrap p{color:#8b949e;margin-top:12px;font-size:13px;text-align:center}

.empty{text-align:center;padding:40px;color:#8b949e}
.alert{padding:10px 14px;border-radius:6px;margin-bottom:14px;font-size:13px}
.alert.error{background:rgba(218,54,51,.15);color:#f85149;border:1px solid #da3633}
.alert.ok{background:rgba(37,211,102,.15);color:#25d366;border:1px solid #25d366}

.plans-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:18px}
.plan-card{background:#161b22;border:1px solid #21262d;border-radius:10px;padding:24px;text-align:center}
.plan-card.featured{border-color:#25d366}
.plan-card h3{font-size:18px;margin-bottom:6px}
.plan-card .price{font-size:32px;font-weight:700;margin:14px 0;color:#25d366}
.plan-card ul{list-style:none;text-align:left;margin:16px 0;font-size:14px}
.plan-card ul li{padding:5px 0;color:#8b949e}
.plan-card ul li:before{content:"✓ ";color:#25d366;font-weight:700}

.msg-list{max-height:50vh;overflow:auto}
.msg-item{padding:10px 12px;border-bottom:1px solid #21262d;font-size:13px}
.msg-item .who{color:#25d366;font-weight:600}
.msg-item .when{color:#8b949e;font-size:11px;float:right}
.msg-item .body{margin-top:4px;color:#c9d1d9}

.progress{width:100%;height:6px;background:#21262d;border-radius:3px;overflow:hidden;margin-top:6px}
.progress-bar{height:100%;background:#25d366;transition:width .3s}
