:root {
  --bg: #090b0b;
  --panel: #111414;
  --panel-2: #171a1a;
  --line: #2a2f2e;
  --text: #f4f7f4;
  --muted: #8f9995;
  --lime: #a7ff28;
  --lime-soft: rgba(167, 255, 40, 0.13);
  --danger: #ff6464;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 85% 0%, rgba(167,255,40,.055), transparent 28%), var(--bg); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.eyebrow { margin: 0 0 7px; color: var(--lime); font: 700 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .15em; }
.muted { color: var(--muted); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; }
.login::before { content: ""; position: absolute; width: 620px; height: 620px; border: 1px solid #202525; border-radius: 50%; box-shadow: 0 0 0 80px rgba(255,255,255,.01), 0 0 0 160px rgba(255,255,255,.008); }
.login-mark { position: fixed; top: 32px; left: 36px; font: 800 18px/1 ui-monospace, monospace; letter-spacing: -.04em; }
.login-mark span { color: var(--lime); }
.login-card { position: relative; width: min(430px, 100%); padding: 38px; background: rgba(17,20,20,.92); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 28px 80px rgba(0,0,0,.45); backdrop-filter: blur(18px); }
h1, h2, h3, p { margin-top: 0; }
.login-card h1 { font-size: 35px; line-height: 1.05; letter-spacing: -.04em; margin-bottom: 12px; }
.login-card .muted { line-height: 1.55; margin-bottom: 28px; }
label { display: grid; gap: 8px; margin-bottom: 16px; color: #bec6c2; font-size: 13px; font-weight: 600; }
label small { color: var(--muted); font-weight: 400; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 9px; background: #0d1010; color: var(--text); padding: 12px 13px; outline: none; transition: border .2s, box-shadow .2s; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus { border-color: var(--lime); box-shadow: 0 0 0 3px var(--lime-soft); }
.primary, .secondary { border-radius: 9px; min-height: 42px; padding: 0 16px; font-weight: 750; border: 1px solid transparent; }
.primary { background: var(--lime); color: #0b0d0c; display: inline-flex; align-items: center; justify-content: center; gap: 18px; }
.primary:hover { background: #b6ff4e; }
.secondary { color: var(--text); background: transparent; border-color: var(--line); }
.secondary:hover { border-color: #59615e; background: #181c1b; }
.wide { width: 100%; }
.form-error { min-height: 18px; color: var(--danger); font-size: 12px; margin: 10px 0 0; }
.app { min-height: 100vh; display: grid; grid-template-columns: 238px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 27px 18px; border-right: 1px solid #222625; display: flex; flex-direction: column; background: rgba(10,12,12,.92); }
.brand { display: flex; gap: 12px; align-items: center; padding: 0 10px 34px; font-size: 15px; line-height: 1.05; }
.brand b { color: var(--lime); }
.brand-icon { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; border: 7px solid var(--lime); font-weight: 900; color: var(--lime); }
nav { display: grid; gap: 5px; }
.nav-item { border: 0; background: transparent; color: #8e9894; text-align: left; padding: 12px 14px; border-radius: 9px; display: flex; align-items: center; gap: 11px; font-weight: 650; }
.nav-item span { width: 22px; font-size: 20px; }
.nav-item:hover { color: var(--text); background: #141717; }
.nav-item.active { color: var(--text); background: var(--lime-soft); box-shadow: inset 2px 0 var(--lime); }
.sidebar-bottom { margin-top: auto; padding: 18px 10px 0; border-top: 1px solid var(--line); }
.server-state { display: flex; gap: 9px; align-items: center; color: #abb3b0; font-size: 12px; margin-bottom: 16px; }
.server-state i { width: 7px; height: 7px; background: var(--lime); border-radius: 50%; box-shadow: 0 0 12px var(--lime); }
.text-button { background: none; border: 0; color: var(--muted); padding: 0; font-size: 12px; }
.workspace { min-width: 0; }
.topbar { min-height: 105px; padding: 24px 34px; border-bottom: 1px solid #222625; display: flex; align-items: center; justify-content: space-between; background: rgba(9,11,11,.82); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 5; }
.topbar h2 { margin: 0; font-size: 25px; letter-spacing: -.025em; }
main { padding: 31px 34px 60px; max-width: 1480px; }
.view { display: none; }
.view.active { display: block; animation: appear .22s ease; }
@keyframes appear { from { opacity: 0; transform: translateY(5px); } }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; margin-bottom: 18px; }
.stat { min-height: 128px; padding: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 13px; position: relative; overflow: hidden; }
.stat::after { content:""; position:absolute; width:70px; height:70px; right:-28px; bottom:-28px; border:1px solid #343a38; border-radius:50%; }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value { font: 750 32px/1 ui-monospace, monospace; margin-top: 22px; }
.stat-detail { color: var(--lime); font-size: 11px; margin-top: 9px; }
.dashboard-grid { display: grid; grid-template-columns: 1.45fr 1fr; gap: 18px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; }
.panel h3 { font-size: 20px; margin-bottom: 0; }
.live-badge { background: var(--lime); color: #111; padding: 5px 7px; font: 800 9px/1 ui-monospace, monospace; border-radius: 4px; }
.pulse-visual { height: 185px; position: relative; display: grid; place-items: center; overflow: hidden; }
.pulse-ring { position: absolute; border: 1px solid rgba(167,255,40,.19); border-radius: 50%; }
.ring-1 { width: 120px; height: 120px; }
.ring-2 { width: 210px; height: 210px; }
.pulse-core { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--lime); color: #111; font: 850 18px/1 ui-monospace,monospace; box-shadow: 0 0 45px rgba(167,255,40,.25); }
.lead { max-width: 660px; color: #c3cac7; line-height: 1.55; }
.connection-list { display: grid; gap: 10px; margin-top: 22px; }
.connection-row { display: flex; align-items: center; justify-content: space-between; padding: 15px 0; border-bottom: 1px solid var(--line); }
.connection-row:last-child { border-bottom: 0; }
.connection-name { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.connection-icon { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px; display: grid; place-items: center; color: var(--lime); font: 700 12px/1 ui-monospace,monospace; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); }
.status::before { content:""; width: 6px; height: 6px; border-radius: 50%; background: #59615e; }
.status.on { color: #c8f88d; }.status.on::before { background: var(--lime); }
.toolbar { min-height: 45px; display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.toolbar p { margin: 0; }
.count-pill { color: var(--muted); border: 1px solid var(--line); border-radius: 30px; padding: 5px 10px; font-size: 11px; }
.agent-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.agent-card { background: var(--panel); border: 1px solid var(--line); border-radius: 13px; padding: 21px; min-height: 250px; display: flex; flex-direction: column; transition: border .2s, transform .2s; }
.agent-card:hover { border-color: #4a514f; transform: translateY(-2px); }
.agent-top { display:flex; justify-content:space-between; gap:10px; }
.agent-number { color: var(--lime); font: 700 11px/1 ui-monospace,monospace; }
.agent-card h3 { margin: 19px 0 8px; font-size: 18px; line-height: 1.25; }
.agent-card p { color: var(--muted); font-size: 13px; line-height: 1.5; }
.agent-meta { display: flex; gap: 7px; flex-wrap: wrap; margin-top: auto; padding-top: 15px; }
.tag { padding: 5px 8px; border-radius: 5px; background: #1a1e1d; color: #aab2af; font: 600 10px/1 ui-monospace,monospace; border: 1px solid #272c2b; }
.agent-actions { display: flex; gap: 8px; padding-top: 16px; }
.agent-actions button { flex: 1; min-height: 36px; font-size: 12px; }
.status-select { border:1px solid var(--line); background:#171b1a; color:#c3cbc7; border-radius:30px; padding:5px 8px; font-size:10px; }
.table-wrap { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: var(--panel); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 16px 18px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; }
th { color: var(--muted); font: 650 10px/1 ui-monospace,monospace; letter-spacing:.09em; }
td { color: #cbd1cf; }
.empty { padding: 56px; text-align: center; color: var(--muted); }
.connections-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.connection-card { padding:22px; border:1px solid var(--line); border-radius:13px; background:var(--panel); display:flex; align-items:center; justify-content:space-between; }
.connection-card h3 { margin:0 0 6px; font-size:16px; }.connection-card p { margin:0; color:var(--muted); font-size:12px; }
.drawer-backdrop, .modal-backdrop { position:fixed; inset:0; background:rgba(0,0,0,.66); backdrop-filter:blur(5px); z-index:20; }
.drawer { position:fixed; z-index:21; right:0; top:0; height:100vh; width:min(650px,100%); background:#101313; border-left:1px solid var(--line); box-shadow:-30px 0 80px rgba(0,0,0,.45); overflow:auto; }
.drawer-head { display:flex; align-items:flex-start; justify-content:space-between; padding:24px 26px; border-bottom:1px solid var(--line); }
.drawer-head h2 { margin:0; font-size:22px; }
.icon-button { width:36px; height:36px; border:1px solid var(--line); border-radius:8px; background:#171a1a; color:var(--text); font-size:24px; line-height:1; }
.agent-form { padding:25px 26px 110px; }
.form-row { display:grid; grid-template-columns:1.5fr 1fr; gap:13px; }
.drawer-actions { position:fixed; right:0; bottom:0; width:min(650px,100%); padding:16px 26px; border-top:1px solid var(--line); background:rgba(16,19,19,.95); display:flex; justify-content:flex-end; gap:9px; }
.modal-backdrop { display:grid; place-items:center; padding:20px; z-index:30; }
.test-modal { width:min(760px,100%); height:min(720px,90vh); background:#101313; border:1px solid var(--line); border-radius:16px; overflow:hidden; display:grid; grid-template-rows:auto 1fr auto auto; box-shadow:0 25px 100px rgba(0,0,0,.6); }
.chat { padding:22px; overflow:auto; display:flex; flex-direction:column; gap:12px; }
.chat-empty { margin:auto; color:var(--muted); font-size:13px; }
.message { max-width:80%; padding:12px 14px; border-radius:12px; line-height:1.5; font-size:13px; white-space:pre-wrap; }
.message.user { align-self:flex-end; background:var(--lime); color:#111; border-bottom-right-radius:3px; }
.message.assistant { align-self:flex-start; background:#1b1f1e; border:1px solid var(--line); border-bottom-left-radius:3px; }
.message.loading { color:var(--muted); }
.chat-form { display:grid; grid-template-columns:1fr auto; gap:10px; padding:16px 20px; border-top:1px solid var(--line); }.chat-form textarea { resize:none; }
.test-modal > .form-error { padding:0 20px; }
.toast { position:fixed; right:24px; bottom:24px; z-index:50; padding:13px 16px; border-radius:9px; background:var(--lime); color:#101210; font-size:13px; font-weight:700; box-shadow:0 12px 40px rgba(0,0,0,.4); }
@media (max-width: 1050px) { .stats { grid-template-columns:repeat(2,1fr); }.agent-grid { grid-template-columns:repeat(2,1fr); } }
@media (max-width: 760px) { .app { grid-template-columns:1fr; }.sidebar { position:fixed; z-index:10; left:0; right:0; bottom:0; top:auto; width:100%; height:68px; padding:8px; border:0; border-top:1px solid var(--line); }.brand,.sidebar-bottom { display:none; } nav { display:grid; grid-template-columns:repeat(4,1fr); } .nav-item { justify-content:center; flex-direction:column; gap:2px; padding:6px; font-size:10px; }.nav-item span { width:auto; font-size:17px; }.topbar { padding:18px 18px; min-height:84px; }.topbar .primary { padding:0 12px; }.topbar h2 { font-size:21px; } main { padding:20px 16px 95px; }.dashboard-grid,.agent-grid,.connections-grid { grid-template-columns:1fr; }.stats { grid-template-columns:1fr 1fr; }.stat { min-height:112px; padding:16px; }.stat-value { font-size:26px; }.form-row { grid-template-columns:1fr; }.table-wrap { overflow-x:auto; } table { min-width:680px; }.login-card { padding:28px 22px; }.login-mark { left:20px; top:20px; } }

