:root {
  --bg: #0f1115; --panel: #171a21; --bubble-user: #2b6cff; --bubble-bot: #1e232c;
  --text: #e8eaed; --muted: #9aa0a6; --accent: #2b6cff; --accent2: #36d399; --border: #23272f;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); height: 100vh; }
.screen { height: 100vh; display: flex; flex-direction: column; }
.hidden { display: none !important; }
.err { color: #ff6b6b; min-height: 16px; }

/* Login */
#login { align-items: center; justify-content: center; }
.login-box { background: var(--panel); padding: 32px; border-radius: 16px; width: 320px; text-align: center; border: 1px solid var(--border); }
.login-box h1 { margin: 0 0 4px; }
.login-box p { color: var(--muted); margin: 0 0 20px; font-size: 13px; }
.login-box input { width: 100%; margin-bottom: 10px; padding: 10px; border-radius: 10px; border: 1px solid var(--border); background: #0f1115; color: var(--text); }
.login-box button { width: 100%; padding: 10px; border: none; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; }

/* Header */
header { display: flex; align-items: center; gap: 16px; padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent2); box-shadow: 0 0 10px var(--accent2); }
header h1 { font-size: 16px; margin: 0; }
#nav { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
#nav button { background: transparent; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 13px; }
#nav button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
#logout { background: transparent; color: var(--muted); border: 1px solid var(--border); border-radius: 10px; padding: 6px 12px; cursor: pointer; }

/* Tabs */
.tab { flex: 1; overflow-y: auto; padding: 16px 20px; }
.bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
select, .bar input, .bar textarea, textarea { background: #0f1115; color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font-size: 13px; font-family: inherit; }
.bar button, .btn { background: var(--accent); color: #fff; border: none; border-radius: 10px; padding: 8px 12px; cursor: pointer; font-size: 13px; text-decoration: none; display: inline-block; }
.btn:hover, .bar button:hover { filter: brightness(1.1); }
.hint { color: var(--muted); font-size: 13px; margin-bottom: 10px; }

/* Cards / detail */
.detail h2 { font-size: 18px; margin: 0 0 8px; }
.detail h3 { font-size: 15px; margin: 16px 0 8px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.status { font-size: 12px; font-weight: 700; color: var(--accent2); margin-left: 6px; }
button.aprove, button.areject { margin-right: 8px; margin-top: 8px; padding: 5px 12px; font-size: 12px; }
button.areject { background: #3a2326; color: #ff9b9b; border-color: #5a3035; }
.card small { color: var(--muted); }
.card ul { margin: 6px 0 0; padding-left: 18px; }
.card button { margin-left: 6px; background: #2a2f3a; color: var(--text); border: none; border-radius: 6px; padding: 3px 8px; cursor: pointer; font-size: 12px; }
pre { white-space: pre-wrap; word-wrap: break-word; background: #0f1115; padding: 10px; border-radius: 8px; max-height: 400px; overflow: auto; }

/* Chat / studio */
.messages { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.bubble { max-width: 85%; padding: 10px 14px; border-radius: 14px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.bubble.user { align-self: flex-end; background: var(--bubble-user); color: #fff; border-bottom-right-radius: 4px; }
.bubble.assistant { align-self: flex-start; background: var(--bubble-bot); border-bottom-left-radius: 4px; }
.composer { display: flex; gap: 10px; }
.composer textarea { flex: 1; resize: none; }
.composer button { align-self: flex-end; }

/* Agent B config */
#abConfig label { display: block; margin: 8px 0; font-size: 13px; color: var(--muted); }
#abConfig input, #abConfig select { display: block; width: 100%; margin-top: 4px; }
