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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

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

.header-left {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.status {
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 4px;
  background: #2a2a4a;
  color: #888;
}

.status-active {
  background: #1b4332;
  color: #2ecc71;
}

.status-waiting {
  background: #3d2e0a;
  color: #f39c12;
  animation: pulse 2s infinite;
}

.status-speaking {
  background: #1b2d4e;
  color: #3498db;
  animation: pulse 1.5s infinite;
}

.status-ended {
  background: #4a1a1a;
  color: #e74c3c;
}

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

main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

#config-panel {
  width: 320px;
  background: #16213e;
  padding: 20px;
  border-right: 1px solid #2a2a4a;
  overflow-y: auto;
}

#config-panel h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
  margin-bottom: 16px;
}

.mode-toggle {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: #0f3460;
  border-radius: 6px;
  padding: 3px;
}

.mode-btn {
  flex: 1;
  padding: 6px 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #888;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.mode-btn.active {
  background: #2ecc71;
  color: #fff;
}

.manual-instructions {
  margin-bottom: 14px;
}

.manual-instructions p {
  font-size: 12px;
  color: #888;
  margin-bottom: 4px;
}

.workstation-link {
  display: inline-block;
  color: #3498db;
  font-size: 13px;
  margin: 4px 0 8px 12px;
  text-decoration: none;
}

.workstation-link:hover { text-decoration: underline; }

.connection-status {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 4px;
  background: #2a2a4a;
  color: #888;
  margin-bottom: 10px;
  text-align: center;
}

.connection-status.connected {
  background: #1b4332;
  color: #2ecc71;
}

.manual-input-area {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

#manual-input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #2a2a4a;
  border-radius: 4px;
  background: #0f3460;
  color: #e0e0e0;
  font-size: 13px;
  outline: none;
}

#manual-input:focus { border-color: #3498db; }

#manual-send-btn {
  padding: 8px 14px;
  background: #3498db;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
}

#manual-send-btn:hover { background: #2980b9; }

#manual-start-btn {
  width: 100%;
  padding: 10px;
  background: #2ecc71;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
}

#manual-start-btn:hover { background: #27ae60; }

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 11px;
  color: #888;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-group select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #2a2a4a;
  border-radius: 4px;
  background: #0f3460;
  color: #e0e0e0;
  font-size: 13px;
  outline: none;
}

.form-group select:focus { border-color: #3498db; }

#start-btn {
  width: 100%;
  padding: 10px;
  background: #2ecc71;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
}

#start-btn:hover { background: #27ae60; }
#start-btn:disabled { background: #555; cursor: not-allowed; }

#end-btn {
  width: 100%;
  padding: 10px;
  background: #e74c3c;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

#end-btn:hover { background: #c0392b; }
#end-btn:disabled { background: #555; cursor: not-allowed; }

#transcript-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#transcript-panel h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
  padding: 12px 20px;
  border-bottom: 1px solid #2a2a4a;
}

#transcript {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.turn {
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.6;
}

.turn-customer {
  background: #0f3460;
  border-left: 3px solid #3498db;
}

.turn-agent {
  background: #1b4332;
  border-left: 3px solid #2ecc71;
}

.turn-system {
  background: #2a2a4a;
  border-left: 3px solid #888;
  font-style: italic;
  color: #999;
}

.turn-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}

.turn-customer .turn-label { color: #3498db; }
.turn-agent .turn-label { color: #2ecc71; }
.turn-system .turn-label { color: #888; }

.turn-text { color: #e0e0e0; }
.turn-system .turn-text { color: #999; }
