/* Agent OS — a small, clean, dark control-panel style. */
:root {
  --bg: #0f1117;
  --panel: #171a23;
  --panel-2: #1e222d;
  --line: #2a2f3a;
  --text: #e6e8ee;
  --muted: #9aa2b1;
  --brand: #6ea8fe;
  --ok: #4ade80;
  --idle: #94a3b8;
  --bad: #f87171;
  --unknown: #fbbf24;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: var(--panel-2); padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--bad); }

/* Layout */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 18px; color: var(--text); }
.topbar nav { display: flex; gap: 10px; align-items: center; }
.wrap { max-width: 960px; margin: 24px auto; padding: 0 16px; }
.page-head { margin-bottom: 18px; }
.page-head h1 { margin: 0 0 4px; }

.banner { padding: 10px 20px; font-size: 14px; }
.banner.warn { background: #3a2f10; color: #fde68a; border-bottom: 1px solid #5a4a15; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px; margin-bottom: 16px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card h2 { margin: 0 0 6px; font-size: 17px; }
.count { color: var(--muted); font-size: 13px; }

/* Agent lists */
.agent-list { list-style: none; margin: 8px 0; padding: 0; }
.agent-list li { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px solid var(--line); }
.agent-list li:first-child { border-top: none; }
.agent-name { font-weight: 600; }
.agent-type { color: var(--muted); font-size: 12px; }
.agent-state { margin-left: auto; color: var(--muted); font-size: 12px; text-transform: capitalize; }

/* Status dot */
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--unknown); flex: none; }
.dot.ok { background: var(--ok); }
.dot.idle { background: var(--idle); }
.dot.bad { background: var(--bad); }
.dot.unknown { background: var(--unknown); }

/* Forms & buttons */
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
input[type=text], input[type=password], select, textarea {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  padding: 9px 11px; border-radius: 8px; font-size: 14px; flex: 1; min-width: 140px;
}
textarea { width: 100%; font-family: inherit; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); }
.btn {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  padding: 9px 14px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.btn:hover { border-color: var(--brand); }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn.primary { background: var(--brand); color: #0b1020; border-color: var(--brand); font-weight: 600; }
.btn.ok { background: #14532d; border-color: #166534; }
.btn.danger { background: #4c1d1d; border-color: #7f1d1d; }
.btn.ghost { background: transparent; }

.controls { display: flex; gap: 8px; margin: 10px 0; }
.controls form { margin: 0; }

/* Chat / logs */
.chat { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.chat h3 { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.messages { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; margin-bottom: 10px; }
.msg { background: var(--panel-2); border-radius: 8px; padding: 7px 10px; font-size: 14px; }
.msg .who { font-weight: 700; margin-right: 6px; text-transform: capitalize; }
.msg.you .who { color: var(--brand); }
.msg.agent .who { color: var(--ok); }
.msg.system .who { color: var(--unknown); }
.msg .when { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }

/* Login */
.centered { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
.card.login { width: 320px; text-align: center; }
.card.login input { width: 100%; margin: 10px 0; }
.card.login .btn { width: 100%; }
