/* Studio Office dashboard — light theme, monochrome + single blue accent. */
:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #1a1a1a;
  --text-soft: #6b7280;
  --accent: #2563eb;
  --accent-soft: #eff4ff;
  --ok: #16a34a;
  --warn: #d97706;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--accent);
  display: inline-block;
}
.brand-name { font-weight: 700; font-size: 16px; }

.metrics { display: flex; gap: 28px; }
.metric { display: flex; flex-direction: column; align-items: flex-end; }
.metric-value { font-weight: 700; font-size: 18px; }
.metric-label { color: var(--text-soft); font-size: 12px; }

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  padding: 20px 24px;
  align-items: start;
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .metrics { gap: 16px; }
}

.panel-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  margin: 0 0 12px;
}

/* ---------- Office floor ---------- */
.floor {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
body.in-meeting .floor {
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 16px;
  outline: 1px dashed var(--accent);
}

.agent-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s ease;
  /* Gentle ambient float so the whole floor feels alive. */
  animation: float 6s ease-in-out infinite;
}
.agent-card:nth-child(2n) { animation-delay: 1.5s; }
.agent-card:nth-child(3n) { animation-delay: 3s; }
.agent-card:nth-child(4n) { animation-delay: 4.5s; }
.agent-card:hover {
  animation-play-state: paused;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.12);
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.agent-head { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
  font-weight: 700; font-size: 15px;
  flex: none;
  /* Always-on "breathing" so the office feels alive even at idle. */
  animation: breathe 3.6s ease-in-out infinite;
  transform-origin: center;
}
/* Stagger so agents don't breathe in unison. */
.agent-card:nth-child(2n) .avatar { animation-delay: 0.6s; }
.agent-card:nth-child(3n) .avatar { animation-delay: 1.2s; }
.agent-card:nth-child(4n) .avatar { animation-delay: 1.8s; }
/* Working/thinking agents breathe faster + get a soft ring. */
.status-working .avatar,
.status-thinking .avatar { animation-duration: 1.6s; box-shadow: 0 0 0 4px var(--accent-soft); }
.status-training .avatar { box-shadow: 0 0 0 4px #dcfce7; }
.status-meeting .avatar { box-shadow: 0 0 0 4px var(--accent-soft); }

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
.agent-name { font-weight: 600; }
.agent-role { color: var(--text-soft); font-size: 12px; }

.status-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-soft); flex: none; }
/* Idle still gently pulses so a resting agent reads as "online", not "off". */
.status-idle .dot { background: #9ca3af; animation: pulse-soft 2.8s ease-in-out infinite; }
.status-working .dot { background: var(--accent); animation: blink 1.2s infinite; }
.status-thinking .dot { background: var(--warn); animation: blink 0.8s infinite; }
.status-waiting .dot { background: var(--warn); animation: pulse-soft 1.6s ease-in-out infinite; }
.status-meeting .dot { background: var(--accent); animation: blink 1.2s infinite; }
.status-training .dot { background: var(--ok); animation: blink 1.2s infinite; }

@keyframes pulse-soft { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }
.status-label { font-size: 12px; color: var(--text-soft); text-transform: capitalize; }

.task-line {
  margin-top: 10px; font-size: 12px; color: var(--text-soft);
  min-height: 16px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* typing dots for "working" */
.typing { display: inline-flex; gap: 3px; margin-left: 4px; }
.typing span {
  width: 4px; height: 4px; border-radius: 50%; background: var(--accent);
  animation: bounce 1s infinite;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

/* ---------- Activity feed ---------- */
.feed {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.feed-list { list-style: none; margin: 0; padding: 0; }
.feed-list li {
  padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: 13px; display: flex; justify-content: space-between; gap: 8px;
}
.feed-list li:last-child { border-bottom: none; }
.feed-action { color: var(--text); }
.feed-time { color: var(--text-soft); font-size: 11px; flex: none; }

/* ---------- Signature bar ---------- */
.signbar {
  position: sticky; bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 14px 24px;
  box-shadow: 0 -1px 3px rgba(16,24,40,0.04);
}
.signbar-head { display: flex; align-items: center; gap: 10px; }
.sign-count {
  background: var(--accent); color: #fff; border-radius: 999px;
  font-size: 12px; font-weight: 700; padding: 1px 8px;
}
.sign-items { display: flex; gap: 12px; overflow-x: auto; padding-top: 10px; }
.sign-chip {
  flex: none; max-width: 280px;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; cursor: pointer; background: var(--surface);
}
.sign-chip:hover { border-color: var(--accent); }
.sign-chip-title { font-weight: 600; font-size: 13px; }
.sign-chip-sum { color: var(--text-soft); font-size: 12px; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { color: var(--text-soft); font-size: 13px; padding-top: 8px; }
