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

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #1a1a2e;
  color: #eee;
  min-height: 100vh;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: #16213e;
  border-bottom: 2px solid #0f3460;
}

header h1 {
  font-size: 1.5rem;
  font-weight: 600;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.music-btn {
  background: #0f3460;
  border: 2px solid #1a4a7a;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
}

.music-btn:hover {
  background: #1a4a7a;
  transform: scale(1.05);
}

.music-btn.playing {
  background: #4ADE80;
  border-color: #4ADE80;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

#clock {
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  color: #888;
}

main {
  display: flex;
  flex: 1;
  gap: 1rem;
  padding: 1rem;
  overflow: hidden;
}

#office {
  background: #2d2d44;
  border-radius: 8px;
  border: 2px solid #0f3460;
  image-rendering: pixelated;
  cursor: pointer;
  flex-shrink: 0;
}

#sidebar {
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
}

#sidebar h2 {
  font-size: 1rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

#team-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.team-member {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #16213e;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.team-member:hover {
  background: #1a2744;
}

.team-member .avatar {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.team-member .info {
  flex: 1;
}

.team-member .name {
  font-weight: 600;
  font-size: 0.95rem;
}

.team-member .status {
  font-size: 0.8rem;
  color: #888;
}

.team-member .status.working {
  color: #4ade80;
}

.team-member .status.idle {
  color: #fbbf24;
}

#activity-log {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-right: 0.5rem;
}

.activity-item {
  padding: 0.5rem 0.75rem;
  background: #16213e;
  border-radius: 6px;
  font-size: 0.85rem;
  border-left: 3px solid #0f3460;
}

.activity-item .time {
  color: #666;
  font-size: 0.75rem;
}

/* Agent detail panel */
#agent-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #16213e;
  border: 2px solid #0f3460;
  border-radius: 12px;
  padding: 1.5rem;
  min-width: 350px;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  z-index: 100;
}

#agent-panel.hidden {
  display: none;
}

#close-panel {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: #888;
  font-size: 1.5rem;
  cursor: pointer;
}

#close-panel:hover {
  color: #fff;
}

#panel-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#panel-content .agent-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#panel-content .agent-avatar {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

#panel-content .agent-name {
  font-size: 1.5rem;
  font-weight: 700;
}

#panel-content .agent-role {
  color: #888;
  font-size: 0.9rem;
}

#panel-content .agent-status {
  padding: 1rem;
  background: #1a1a2e;
  border-radius: 8px;
}

#panel-content .agent-status h3 {
  font-size: 0.85rem;
  color: #888;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

#panel-content .agent-task {
  font-size: 1rem;
  line-height: 1.5;
}

#panel-content .agent-task.session-key {
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  color: #4ADE80;
  background: #1a1a2e;
  padding: 0.5rem;
  border-radius: 4px;
  word-break: break-all;
}

#panel-content .activity-history {
  max-height: 200px;
  overflow-y: auto;
}

#panel-content .history-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

#panel-content .history-item {
  font-size: 0.85rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid #0f3460;
}

#panel-content .history-item:last-child {
  border-bottom: none;
}

#panel-content .history-time {
  color: #666;
  font-size: 0.75rem;
  font-family: 'Courier New', monospace;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #1a1a2e;
}

::-webkit-scrollbar-thumb {
  background: #0f3460;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #1a4a7a;
}

/* Mobile responsive */
@media (max-width: 768px) {
  header {
    padding: 0.75rem 1rem;
  }
  
  header h1 {
    font-size: 1.2rem;
  }
  
  main {
    flex-direction: column;
    padding: 0.5rem;
    gap: 0.5rem;
  }
  
  #office {
    width: 100% !important;
    height: auto !important;
    max-width: 100vw;
  }
  
  #sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  #sidebar h2 {
    width: 100%;
    font-size: 0.85rem;
  }
  
  #team-list {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
  }
  
  .team-member {
    flex: 1;
    min-width: 120px;
    padding: 0.5rem;
  }
  
  .team-member .avatar {
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
  }
  
  .team-member .name {
    font-size: 0.85rem;
  }
  
  .team-member .status {
    font-size: 0.7rem;
  }
  
  #activity-log {
    max-height: 120px;
    width: 100%;
  }
  
  #agent-panel {
    width: 90vw;
    min-width: auto;
    max-width: 90vw;
  }
}
