* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0d1117;
  --surface: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --blue: #58a6ff;
  --green: #3fb950;
  --yellow: #d29922;
  --red: #f85149;
  --gray: #6e7681;
  --org: #58a6ff;
  --group: #3fb950;
  --direct: #8b949e;
  --system: #d29922;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

header h1 {
  font-size: 16px;
  font-weight: 600;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.online { background: var(--green); }
.status-dot.offline { background: var(--red); }

nav {
  display: flex;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 41px;
  z-index: 9;
}

.tab {
  flex: 1;
  padding: 10px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.tab-content { display: none; padding: 8px; }
.tab-content.active { display: block; }

/* Messages */
.message {
  padding: 10px 12px;
  margin: 4px 0;
  background: var(--surface);
  border-radius: 8px;
  border-left: 3px solid var(--gray);
  font-size: 13px;
}
.message.channel-org { border-left-color: var(--org); }
.message.channel-group { border-left-color: var(--group); }
.message.channel-direct { border-left-color: var(--direct); }
.message.channel-system { border-left-color: var(--system); }
.message.priority-critical {
  border-left-color: var(--red);
  background: #1a0f0f;
}
.message.priority-high {
  border-left-color: var(--yellow);
}

.message-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}
.message-from {
  font-weight: 600;
  color: var(--blue);
  font-size: 12px;
}
.message-channel {
  font-size: 11px;
  color: var(--text-muted);
}
.message-time {
  font-size: 11px;
  color: var(--text-muted);
}
.message-type {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.message-body {
  word-break: break-word;
}

/* Agent cards */
.agent-card {
  padding: 14px;
  margin: 6px 0;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.agent-card .agent-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.agent-card .agent-name {
  font-weight: 600;
  font-size: 15px;
}
.agent-card .agent-status {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 12px;
}
.agent-status.online { background: #0d2818; color: var(--green); }
.agent-status.offline { background: #2d1117; color: var(--red); }
.agent-card .agent-detail {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Channel filter */
#channel-filter {
  margin-bottom: 8px;
}
#channel-select {
  width: 100%;
  padding: 8px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}

/* Scrolling */
main {
  padding-bottom: 60px;
}
