* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: #ffffff;
  color: #1D1C1D;
}

.app {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: #3F0E40;
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 16px 0;
}

.workspace-header {
  padding: 0 16px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  margin-bottom: 12px;
}
.workspace-name { font-weight: 800; font-size: 18px; }
.workspace-user { font-size: 13px; color: rgba(255,255,255,0.7); margin-top: 2px; }

.scenario-picker {
  padding: 8px 16px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  margin-bottom: 12px;
}
.scenario-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.55);
  margin-bottom: 6px;
}
#scenario-select {
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 13px;
}
#scenario-select option { color: #1D1C1D; }

.nav-section { padding: 0 8px; margin-bottom: 18px; }
.nav-heading {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.55);
  padding: 6px 8px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.85);
  padding: 7px 8px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}
.nav-item:hover:not(:disabled) { background: rgba(255,255,255,0.1); }
.nav-item.active { background: #1164A3; color: #fff; }
.nav-item:disabled { opacity: 0.45; cursor: default; }

.nav-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.nav-dot--directory { background: #36C5AB; }

.avatar {
  width: 24px; height: 24px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; background: #6E56CF;
  flex-shrink: 0;
}
.avatar--pace { background: linear-gradient(135deg, #6E56CF, #36C5AB); }
.avatar--sm { width: 20px; height: 20px; font-size: 10px; }

/* Main */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.view { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.hidden { display: none !important; }

.channel-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid #E8E8E8;
}
.channel-title { font-weight: 800; font-size: 16px; }
.channel-subtitle { font-size: 12px; color: #616061; }

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.msg { display: flex; gap: 10px; max-width: 760px; }
.msg .avatar { margin-top: 2px; }
.msg-body { flex: 1; }
.msg-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.msg-name { font-weight: 800; font-size: 14px; }
.msg-time { font-size: 11px; color: #868686; }
.msg-text { font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; }
.msg-text ul { margin: 6px 0; padding-left: 20px; }
.msg-text li { margin: 2px 0; }

.msg--user .msg-name { color: #1264A3; }
.msg--pace .msg-name { color: #6E56CF; }

.msg-text.typing { color: #868686; font-style: italic; }

.composer {
  display: flex;
  gap: 8px;
  padding: 14px 20px 20px 20px;
  border-top: 1px solid #E8E8E8;
}
.composer input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #D0D0D0;
  font-size: 14px;
}
.composer button {
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  background: #611f69;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.composer button:disabled { opacity: 0.5; cursor: default; }

/* Agent directory */
.view--directory { padding: 4px 0; }
.agent-grid {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  align-content: start;
}
.agent-card {
  border: 1px solid #E5E5E5;
  border-radius: 10px;
  padding: 14px 16px;
  background: #FBFBFB;
}
.agent-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.agent-card-title { font-weight: 800; font-size: 15px; }
.agent-card-sub { font-size: 12px; color: #616061; }
.status-pill {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
}
.status-pill--active { background: #E3F6E8; color: #1E7A34; }
.status-pill--under.review, .status-pill--under-review { background: #FFF4D6; color: #9A6700; }

.agent-field { font-size: 12.5px; margin: 6px 0; }
.agent-field b { color: #444; }
.agent-actions { margin-top: 8px; border-top: 1px dashed #E0E0E0; padding-top: 8px; }
.agent-actions-heading { font-size: 11px; text-transform: uppercase; color: #868686; margin-bottom: 4px; }
.agent-action { font-size: 12px; margin: 3px 0; }
