* { box-sizing: border-box; margin: 0; padding: 0; }
:root{
  --bg:#0f1320; --panel:#171c2e; --panel2:#1f2640; --line:#2a3252;
  --txt:#e7ecff; --muted:#8b93b5; --accent:#5b8cff; --green:#39d98a; --red:#ff5d6c; --yellow:#ffcf5c;
}
body{ font-family:system-ui,Segoe UI,Roboto,sans-serif; background:var(--bg); color:var(--txt); height:100vh; }
.hidden{ display:none !important; }
.muted{ color:var(--muted); font-size:13px; }
.error{ color:var(--red); font-size:13px; min-height:18px; margin-top:6px; }
button{ cursor:pointer; border:none; border-radius:8px; padding:9px 14px; font-size:14px; background:var(--accent); color:#fff; font-weight:600; }
button:hover{ filter:brightness(1.1); }
button.ghost{ background:var(--panel2); color:var(--txt); }
button.danger{ background:var(--red); }
button.gray{ background:#39415f; }
input,select,textarea{ background:var(--panel2); border:1px solid var(--line); color:var(--txt); border-radius:8px; padding:9px 11px; font-size:14px; width:100%; font-family:inherit; }
label{ font-size:12px; color:var(--muted); display:block; margin:10px 0 4px; }

/* LOGIN */
.login-wrap{ height:100vh; display:flex; align-items:center; justify-content:center; }
.login-card{ background:var(--panel); padding:34px; border-radius:16px; width:330px; border:1px solid var(--line); }
.login-card h1{ font-size:24px; }
.login-card p{ margin-bottom:18px; }
.login-card input{ margin-bottom:12px; }
.login-card button{ width:100%; }

/* APP */
header{ height:58px; background:var(--panel); border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; padding:0 18px; }
.brand{ font-weight:700; font-size:18px; }
.header-actions{ display:flex; gap:8px; }
.layout{ display:flex; height:calc(100vh - 58px); }
aside{ width:300px; background:var(--panel); border-right:1px solid var(--line); overflow-y:auto; padding:10px; }
main{ flex:1; overflow-y:auto; padding:18px; }
.empty{ color:var(--muted); text-align:center; margin-top:60px; }

.side-title{ font-size:11px; text-transform:uppercase; letter-spacing:.5px; color:var(--muted); padding:4px 4px 8px; font-weight:700; }
.acc-row{ display:flex; justify-content:space-between; align-items:center; background:var(--panel2); border:1px solid var(--line); border-radius:8px; padding:8px 10px; margin-bottom:6px; font-size:13px; }
button.mini{ padding:3px 8px; font-size:12px; }

/* bot card */
.bot-card{ background:var(--panel2); border:1px solid var(--line); border-radius:10px; padding:12px; margin-bottom:10px; cursor:pointer; }
.bot-card.active{ border-color:var(--accent); }
.bot-card .row{ display:flex; justify-content:space-between; align-items:center; }
.bot-card .name{ font-weight:600; }
.bot-card .sub{ font-size:12px; color:var(--muted); margin-top:3px; }
.dot{ width:9px; height:9px; border-radius:50%; display:inline-block; margin-right:6px; }
.dot.online{ background:var(--green); } .dot.offline{ background:#566; } .dot.connecting{ background:var(--yellow); } .dot.login-pending{ background:var(--accent); }

/* detail */
.tabs{ display:flex; gap:6px; margin-bottom:14px; flex-wrap:wrap; }
.tabs button{ background:var(--panel2); }
.tabs button.active{ background:var(--accent); }
.card{ background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:16px; margin-bottom:14px; }
.detail-head{ display:flex; justify-content:space-between; align-items:center; margin-bottom:14px; }
.detail-head h2{ font-size:20px; }
.statline{ display:flex; gap:18px; flex-wrap:wrap; font-size:13px; color:var(--muted); margin-top:6px; }
.statline b{ color:var(--txt); }

/* chat */
.chat-box{ height:48vh; overflow-y:auto; background:#0c1020; border:1px solid var(--line); border-radius:10px; padding:10px; font-size:13px; line-height:1.5; }
.chat-line{ padding:1px 0; word-break:break-word; }
.chat-line.mention{ background:rgba(255,207,92,.15); border-left:3px solid var(--yellow); padding-left:6px; }
.chat-time{ color:var(--muted); margin-right:6px; }
.chat-input{ display:flex; gap:8px; margin-top:10px; }
.chat-input input{ flex:1; }

.msa{ background:rgba(91,140,255,.15); border:1px solid var(--accent); border-radius:10px; padding:12px; margin-bottom:12px; }
.msa code{ font-size:18px; font-weight:700; background:#000; padding:2px 8px; border-radius:6px; }

.cmd-row{ display:flex; gap:8px; margin-bottom:8px; align-items:center; }
.cmd-row input.txt{ flex:1; }
.cmd-row input.delay{ width:90px; }
.grid2{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.inline{ display:flex; align-items:center; gap:8px; }
.inline input[type=checkbox]{ width:auto; }
table{ width:100%; border-collapse:collapse; font-size:13px; }
td,th{ padding:6px 8px; border-bottom:1px solid var(--line); text-align:left; }

/* modal */
.modal-bg{ position:fixed; inset:0; background:rgba(0,0,0,.6); display:flex; align-items:center; justify-content:center; }
.modal{ background:var(--panel); border:1px solid var(--line); border-radius:14px; padding:22px; width:380px; max-height:90vh; overflow-y:auto; }
.modal h3{ margin-bottom:12px; }
.modal .actions{ display:flex; gap:8px; justify-content:flex-end; margin-top:16px; }
